String tmp = URIUtil.decodePath(resource.getURL().getPath()); if (tmp.endsWith("/")) tmp = tmp.substring(0, tmp.length()-1);
public static String decodePath(String path) { return decodePath(path,0,path.length()); }
@Override protected synchronized void newConnection() throws IOException { super.newConnection(); _entry=null; _file=null; _jarFile=null; _list=null; int sep = _urlString.lastIndexOf("!/"); _jarUrl=_urlString.substring(0,sep+2); _path=URIUtil.decodePath(_urlString.substring(sep+2)); if (_path.length()==0) _path=null; _jarFile=_jarConnection.getJarFile(); _file=new File(_jarFile.getName()); }
public static boolean equalsIgnoreEncodings(String uriA, String uriB) { int lenA=uriA.length(); int lenB=uriB.length(); int a=0; int b=0; while (a<lenA && b<lenB) { int oa=uriA.charAt(a++); int ca=oa; if (ca=='%') ca=TypeUtil.convertHexDigit(uriA.charAt(a++))*16+TypeUtil.convertHexDigit(uriA.charAt(a++)); int ob=uriB.charAt(b++); int cb=ob; if (cb=='%') cb=TypeUtil.convertHexDigit(uriB.charAt(b++))*16+TypeUtil.convertHexDigit(uriB.charAt(b++)); if (ca=='/' && oa!=ob) return false; if (ca!=cb ) return URIUtil.decodePath(uriA).equals(URIUtil.decodePath(uriB)); } return a==lenA && b==lenB; }
file = new File(uri); else file = new File("//"+uri.getAuthority()+URIUtil.decodePath(url.getFile()));
Arrays.sort(ls); String decodedBase = URIUtil.decodePath(base); String title = "Directory: "+deTag(decodedBase);
Arrays.sort(ls); String decodedBase = URIUtil.decodePath(base); String title = "Directory: "+deTag(decodedBase);
@Override public String getDecodedPath() { if (_path==_param) return null; return URIUtil.decodePath(_raw,_path,_param-_path); }
public String getDecodedPath() { if (_decodedPath==null && _path!=null) _decodedPath=URIUtil.decodePath(_path); return _decodedPath; }
@Override public String getDecodedPath() { if (_path==_param) return null; return URIUtil.decodePath(_raw,_path,_param-_path); }
public String getDecodedPath() { if (_decodedPath==null && _path!=null) _decodedPath=URIUtil.decodePath(_path); return _decodedPath; }
@Override public String getDecodedPath() { if (_path==_param) return null; return URIUtil.decodePath(_raw,_path,_param-_path); }
@Override public String getDecodedPath() { if (_path==_param) return null; return URIUtil.decodePath(_raw,_path,_param-_path); }
public String getDecodedPath() { if (_decodedPath==null && _path!=null) _decodedPath=URIUtil.decodePath(_path); return _decodedPath; }
@Override public String getDecodedPath() { if (_path==_param) return null; return URIUtil.decodePath(_raw,_path,_param-_path); }
public static String decodePath(String path) { return decodePath(path,0,path.length()); }
protected String decodePostData(String contentType, String data) { if (contentType.startsWith("application/x-www-form-urlencoded")) { if (data.substring(0, 5).equals("data=")) { return URIUtil.decodePath(data.substring(5)); } else { return ""; } } else if (contentType.startsWith("text/plain")) { return data; } else { // TODO: Treat as text for now, maybe error in the future. return data; } }
protected String decodePostData(String contentType, String data) { if (contentType.startsWith("application/x-www-form-urlencoded")) { if (data.substring(0, 5).equals("data=")) { return URIUtil.decodePath(data.substring(5)); } else { return ""; } } else if (contentType.startsWith("text/plain")) { return data; } else { // TODO: Treat as text for now, maybe error in the future. return data; } }
@Override protected synchronized void newConnection() throws IOException { super.newConnection(); _entry=null; _file=null; _jarFile=null; _list=null; int sep = _urlString.lastIndexOf("!/"); _jarUrl=_urlString.substring(0,sep+2); _path=URIUtil.decodePath(_urlString.substring(sep+2)); if (_path.length()==0) _path=null; _jarFile=_jarConnection.getJarFile(); _file=new File(_jarFile.getName()); }
public static boolean equalsIgnoreEncodings(String uriA, String uriB) { int lenA=uriA.length(); int lenB=uriB.length(); int a=0; int b=0; while (a<lenA && b<lenB) { int oa=uriA.charAt(a++); int ca=oa; if (ca=='%') ca=TypeUtil.convertHexDigit(uriA.charAt(a++))*16+TypeUtil.convertHexDigit(uriA.charAt(a++)); int ob=uriB.charAt(b++); int cb=ob; if (cb=='%') cb=TypeUtil.convertHexDigit(uriB.charAt(b++))*16+TypeUtil.convertHexDigit(uriB.charAt(b++)); if (ca=='/' && oa!=ob) return false; if (ca!=cb ) return URIUtil.decodePath(uriA).equals(URIUtil.decodePath(uriB)); } return a==lenA && b==lenB; } }