[libbluray-devel] [cosmetics][java] Fix format/indentation of MountManager.java.

ace20022 git at videolan.org
Fri Nov 28 13:09:15 CET 2014


libbluray | branch: master | ace20022 <ace20022 at ymail.com> | Fri Nov 28 12:15:40 2014 +0100| [1371724e4abbdface44a8875d4fceb9c9fca0d0a] | committer: ace20022

[cosmetics][java] Fix format/indentation of MountManager.java.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1371724e4abbdface44a8875d4fceb9c9fca0d0a
---

 .../bdj/java/org/videolan/MountManager.java        |  122 ++++++++++----------
 1 file changed, 61 insertions(+), 61 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/MountManager.java b/src/libbluray/bdj/java/org/videolan/MountManager.java
index 6514de8..75a2333 100644
--- a/src/libbluray/bdj/java/org/videolan/MountManager.java
+++ b/src/libbluray/bdj/java/org/videolan/MountManager.java
@@ -66,76 +66,75 @@ public class MountManager {
                 }
             }
 
-        String path = System.getProperty("bluray.vfs.root") + "/BDMV/JAR/" + jarStr + ".jar";
+            String path = System.getProperty("bluray.vfs.root") + "/BDMV/JAR/" + jarStr + ".jar";
 
-        JarFile jar = null;
-        try {
-            jar = new JarFile(path);
-            if (mountPoint == null) {
-                mountPoint = new MountPoint(jarStr, classFiles);
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-            if (jar != null) {
-                try {
-                    jar.close();
-                } catch (IOException e1) {
-                    e1.printStackTrace();
+            JarFile jar = null;
+            try {
+                jar = new JarFile(path);
+                if (mountPoint == null) {
+                    mountPoint = new MountPoint(jarStr, classFiles);
                 }
+            } catch (IOException e) {
+                e.printStackTrace();
+                if (jar != null) {
+                    try {
+                        jar.close();
+                    } catch (IOException e1) {
+                        e1.printStackTrace();
+                    }
+                }
+                throw new MountException();
             }
-            throw new MountException();
-        }
 
-        try {
-            byte[] buffer = new byte[32*1024];
-            Enumeration entries = jar.entries();
-            while (entries.hasMoreElements()) {
-                JarEntry entry = (JarEntry)entries.nextElement();
-                File out = new File(mountPoint.getMountPoint() + File.separator + entry.getName());
-
-                if (entry.isDirectory()) {
-                    out.mkdirs();
-                } else if (!classFiles && entry.getName().endsWith(".class")) {
-                    //logger.info("skip " + entry.getName());
-                } else {
-                    /* make sure path exists */
-                    out.getParentFile().mkdirs();
-
-                    logger.info("   mount: " + entry.getName());
-
-                    InputStream inStream = jar.getInputStream(entry);
-                    OutputStream outStream = new FileOutputStream(out);
-
-                    int length;
-                    while ((length = inStream.read(buffer)) > 0) {
-                        outStream.write(buffer, 0, length);
+            try {
+                byte[] buffer = new byte[32 * 1024];
+                Enumeration entries = jar.entries();
+                while (entries.hasMoreElements()) {
+                    JarEntry entry = (JarEntry)entries.nextElement();
+                    File out = new File(mountPoint.getMountPoint() + File.separator + entry.getName());
+
+                    if (entry.isDirectory()) {
+                        out.mkdirs();
+                    } else if (!classFiles && entry.getName().endsWith(".class")) {
+                        // logger.info("skip " + entry.getName());
+                    } else {
+                        /* make sure path exists */
+                        out.getParentFile().mkdirs();
+
+                        logger.info("   mount: " + entry.getName());
+
+                        InputStream inStream = jar.getInputStream(entry);
+                        OutputStream outStream = new FileOutputStream(out);
+
+                        int length;
+                        while ((length = inStream.read(buffer)) > 0) {
+                            outStream.write(buffer, 0, length);
+                        }
+
+                        inStream.close();
+                        outStream.close();
                     }
-
-                    inStream.close();
-                    outStream.close();
                 }
+            } catch (IOException e) {
+                e.printStackTrace();
+                mountPoint.remove();
+                throw new MountException();
             }
-        } catch (IOException e) {
-            e.printStackTrace();
-            mountPoint.remove();
-            throw new MountException();
-        }
 
-        if (mountPoint.classFiles() != classFiles) {
-            if (mountPoint.classFiles()) {
-                logger.error("assertion failed");
+            if (mountPoint.classFiles() != classFiles) {
+                if (mountPoint.classFiles()) {
+                    logger.error("assertion failed");
+                } else {
+                    logger.info("Remounting FULL JAR " + jarId + " complete.");
+                    mountPoint.setClassFiles();
+                }
             } else {
-                logger.info("Remounting FULL JAR " + jarId + " complete.");
-                mountPoint.setClassFiles();
-            }
-        } else {
-            logger.info("Mounting " + (classFiles ? "FULL" : "PARTIAL") +
-                        " JAR " + jarId + " complete.");
+                logger.info("Mounting " + (classFiles ? "FULL" : "PARTIAL") + " JAR " + jarId + " complete.");
 
-            mountPoints.put(new Integer(jarId), mountPoint);
-        }
+                mountPoints.put(new Integer(jarId), mountPoint);
+            }
 
-        return mountPoint.getMountPoint();
+            return mountPoint.getMountPoint();
         }
     }
 
@@ -200,7 +199,7 @@ public class MountManager {
 
     private static class MountPoint {
         public MountPoint(String id, boolean classFiles) throws IOException {
-            this.dir      = CacheDir.create("mount", id);
+            this.dir = CacheDir.create("mount", id);
             this.refCount = 1;
             this.classFiles = classFiles;
         }
@@ -235,12 +234,13 @@ public class MountManager {
         public boolean classFiles() {
             return classFiles;
         }
+
         public boolean setClassFiles() {
             return classFiles == true;
         }
 
         private File dir;
-        private int  refCount;
+        private int refCount;
         private boolean classFiles;
     };
 }



More information about the libbluray-devel mailing list