Revision 2746 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/util/URLUtils.java
URLUtils.java | ||
---|---|---|
120 | 120 |
if (url == null) { |
121 | 121 |
return null; |
122 | 122 |
} |
123 |
String path; |
|
123 |
String protocol = url.getProtocol(); |
|
124 |
String path = url.getPath(); |
|
125 |
if (protocol == null || path == null || path.isEmpty() || !protocol.equalsIgnoreCase("file")) { |
|
126 |
return null; |
|
127 |
} |
|
128 |
|
|
124 | 129 |
if (!isDynamic(url)) { |
125 | 130 |
return FileUtils.toFile(url);//url.toURI().getPath(); |
126 | 131 |
} |
127 |
path = url.getPath(); |
|
128 | 132 |
return new File(path); |
129 | 133 |
} |
130 | 134 |
|
Also available in: Unified diff