Latest bnd code
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1350613 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/aQute/lib/osgi/FileResource.java b/bundleplugin/src/main/java/aQute/lib/osgi/FileResource.java
index b849878..4d2459d 100755
--- a/bundleplugin/src/main/java/aQute/lib/osgi/FileResource.java
+++ b/bundleplugin/src/main/java/aQute/lib/osgi/FileResource.java
@@ -6,7 +6,7 @@
public class FileResource implements Resource {
File file;
String extra;
-
+
public FileResource(File file) {
this.file = file;
}
@@ -16,11 +16,7 @@
}
public static void build(Jar jar, File directory, Pattern doNotCopy) {
- traverse(
- jar,
- directory.getAbsolutePath().length(),
- directory,
- doNotCopy);
+ traverse(jar, directory.getAbsolutePath().length(), directory, doNotCopy);
}
public String toString() {
@@ -31,8 +27,7 @@
copy(this, out);
}
- static synchronized void copy(Resource resource, OutputStream out)
- throws Exception {
+ static synchronized void copy(Resource resource, OutputStream out) throws Exception {
InputStream in = resource.openInputStream();
try {
byte buffer[] = new byte[20000];
@@ -47,19 +42,17 @@
}
}
- static void traverse(Jar jar, int rootlength, File directory,
- Pattern doNotCopy) {
+ static void traverse(Jar jar, int rootlength, File directory, Pattern doNotCopy) {
if (doNotCopy != null && doNotCopy.matcher(directory.getName()).matches())
return;
jar.updateModified(directory.lastModified(), "Dir change");
-
+
File files[] = directory.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory())
traverse(jar, rootlength, files[i], doNotCopy);
else {
- String path = files[i].getAbsolutePath().substring(
- rootlength + 1);
+ String path = files[i].getAbsolutePath().substring(rootlength + 1);
if (File.separatorChar != '/')
path = path.replace(File.separatorChar, '/');
jar.putResource(path, new FileResource(files[i]), true);
@@ -78,8 +71,8 @@
public void setExtra(String extra) {
this.extra = extra;
}
-
+
public long size() {
- return (int) file.length();
+ return (int) file.length();
}
}