diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
commit | df9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch) | |
tree | 239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/common/net/AssetURLContext.java | |
parent | eb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/com/jogamp/common/net/AssetURLContext.java')
-rw-r--r-- | src/java/com/jogamp/common/net/AssetURLContext.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/java/com/jogamp/common/net/AssetURLContext.java b/src/java/com/jogamp/common/net/AssetURLContext.java index 38691e8..2ada3c6 100644 --- a/src/java/com/jogamp/common/net/AssetURLContext.java +++ b/src/java/com/jogamp/common/net/AssetURLContext.java @@ -59,7 +59,7 @@ public abstract class AssetURLContext implements PiggybackURLContext { * @return * @throws MalformedURLException */ - public static URL createURL(String path, ClassLoader cl) throws MalformedURLException { + public static URL createURL(final String path, final ClassLoader cl) throws MalformedURLException { return new URL(null, path.startsWith(asset_protocol_prefix) ? path : asset_protocol_prefix + path, createHandler(cl)); } @@ -75,7 +75,7 @@ public abstract class AssetURLContext implements PiggybackURLContext { * @return * @throws MalformedURLException */ - public static URL createURL(String path) throws MalformedURLException { + public static URL createURL(final String path) throws MalformedURLException { return new URL(path.startsWith(asset_protocol_prefix) ? path : asset_protocol_prefix + path); } @@ -94,7 +94,7 @@ public abstract class AssetURLContext implements PiggybackURLContext { * * @return true if successful, otherwise false */ - public static boolean registerHandler(ClassLoader cl) { + public static boolean registerHandler(final ClassLoader cl) { final GenericURLStreamHandlerFactory f = GenericURLStreamHandlerFactory.register(); if( null != f ) { f.setHandler(asset_protocol, createHandler(cl)); @@ -141,11 +141,11 @@ public abstract class AssetURLContext implements PiggybackURLContext { * </p> **/ @Override - public URLConnection resolve(String path) throws IOException { + public URLConnection resolve(final String path) throws IOException { return resolve(path, getClassLoader()); } - public static URLConnection resolve(String path, ClassLoader cl) throws IOException { + public static URLConnection resolve(String path, final ClassLoader cl) throws IOException { URL url = null; URLConnection conn = null; int type = -1; @@ -155,7 +155,7 @@ public abstract class AssetURLContext implements PiggybackURLContext { } try { path = IOUtil.cleanPathString(path); - } catch (URISyntaxException uriEx) { + } catch (final URISyntaxException uriEx) { throw new IOException(uriEx); } @@ -164,7 +164,7 @@ public abstract class AssetURLContext implements PiggybackURLContext { url = new URL(path); conn = open(url); type = null != conn ? 1 : -1; - } catch(MalformedURLException e1) { if(DEBUG) { System.err.println("ERR(0): "+e1.getMessage()); } } + } catch(final MalformedURLException e1) { if(DEBUG) { System.err.println("ERR(0): "+e1.getMessage()); } } if(null == conn && null != cl) { // lookup via ClassLoader .. cleanup leading '/' @@ -183,13 +183,13 @@ public abstract class AssetURLContext implements PiggybackURLContext { if(null == conn) { // lookup as File try { - File file = new File(path); + final File file = new File(path); if(file.exists()) { url = IOUtil.toURISimple(file).toURL(); conn = open(url); type = null != conn ? 3 : -1; } - } catch (Throwable e) { if(DEBUG) { System.err.println("ERR(1): "+e.getMessage()); } } + } catch (final Throwable e) { if(DEBUG) { System.err.println("ERR(1): "+e.getMessage()); } } } if(DEBUG) { @@ -201,7 +201,7 @@ public abstract class AssetURLContext implements PiggybackURLContext { return conn; } - private static URLConnection open(URL url) { + private static URLConnection open(final URL url) { if(null==url) { return null; } @@ -209,7 +209,7 @@ public abstract class AssetURLContext implements PiggybackURLContext { final URLConnection c = url.openConnection(); c.connect(); // redundant return c; - } catch (IOException ioe) { if(DEBUG) { System.err.println("ERR: "+ioe.getMessage()); } } + } catch (final IOException ioe) { if(DEBUG) { System.err.println("ERR: "+ioe.getMessage()); } } return null; } |