/** * Returns the JAR entry path. * * @return The JAR entry path. */ public String getJarEntryPath() { String result = null; if (getSchemeProtocol().equals(Protocol.JAR)) { final String ssp = getSchemeSpecificPart(); if (ssp != null) { final int separatorIndex = ssp.indexOf("!/"); if (separatorIndex != -1) { result = ssp.substring(separatorIndex + 2); } } } return result; }
/** * Returns the JAR entry path. * * @return The JAR entry path. */ public String getJarEntryPath() { String result = null; if (Protocol.JAR.equals(getSchemeProtocol())) { final String ssp = getSchemeSpecificPart(); if (ssp != null) { final int separatorIndex = ssp.indexOf("!/"); if (separatorIndex != -1) { result = ssp.substring(separatorIndex + 2); } } } return result; }
/** * Returns the JAR file reference. * * @return The JAR file reference. */ public Reference getJarFileRef() { Reference result = null; if (getSchemeProtocol().equals(Protocol.JAR)) { final String ssp = getSchemeSpecificPart(); if (ssp != null) { final int separatorIndex = ssp.indexOf("!/"); if (separatorIndex != -1) { result = new Reference(ssp.substring(0, separatorIndex)); } } } return result; }
/** * Returns the JAR file reference. * * @return The JAR file reference. */ public Reference getJarFileRef() { Reference result = null; if (Protocol.JAR.equals(getSchemeProtocol())) { final String ssp = getSchemeSpecificPart(); if (ssp != null) { final int separatorIndex = ssp.indexOf("!/"); if (separatorIndex != -1) { result = new Reference(ssp.substring(0, separatorIndex)); } } } return result; }
/** * Gets the local file corresponding to the reference. Only URIs referring * to the "localhost" or to an empty authority are supported. * * @return The local file corresponding to the reference. */ public File getFile() { File result = null; if (Protocol.FILE.equals(getSchemeProtocol())) { final String hostName = getAuthority(); if ((hostName == null) || hostName.equals("") || hostName.equalsIgnoreCase("localhost")) { final String filePath = Reference.decode(getPath()); result = new File(filePath); } else { throw new RuntimeException( "Can't resolve files on remote host machines"); } } return result; }
/** * Gets the local file corresponding to the reference. Only URIs referring * to the "localhost" or to an empty authority are supported. * * @return The local file corresponding to the reference. */ public File getFile() { File result = null; if (getSchemeProtocol().equals(Protocol.FILE)) { final String hostName = getAuthority(); if ((hostName == null) || hostName.equals("") || hostName.equalsIgnoreCase("localhost")) { final String filePath = Reference.decode(getPath()); result = new File(filePath); } else { throw new RuntimeException( "Can't resolve files on remote host machines"); } } return result; }
/** * Returns the type of authority. * * @return The type of authority. */ public int getClapAuthorityType() { int result = 0; if (getSchemeProtocol().equals(Protocol.CLAP)) { final String authority = getAuthority(); if (authority != null) { if (authority.equalsIgnoreCase(getAuthorityName(CLAP_CLASS))) { result = CLAP_CLASS; } else if (authority .equalsIgnoreCase(getAuthorityName(CLAP_SYSTEM))) { result = CLAP_SYSTEM; } else if (authority .equalsIgnoreCase(getAuthorityName(CLAP_THREAD))) { result = CLAP_THREAD; } } } return result; }
/** * Returns the type of authority. * * @return The type of authority. */ public int getRiapAuthorityType() { int result = 0; if (getSchemeProtocol().equals(Protocol.RIAP)) { final String authority = getAuthority(); if (authority != null) { if (authority .equalsIgnoreCase(getAuthorityName(RIAP_APPLICATION))) { result = RIAP_APPLICATION; } else if (authority .equalsIgnoreCase(getAuthorityName(RIAP_COMPONENT))) { result = RIAP_COMPONENT; } else if (authority .equalsIgnoreCase(getAuthorityName(RIAP_HOST))) { result = RIAP_HOST; } } } return result; }
/** * Returns the type of authority. * * @return The type of authority. */ public int getClapAuthorityType() { int result = 0; if (Protocol.CLAP.equals(getSchemeProtocol())) { final String authority = getAuthority(); if (authority != null) { if (authority.equalsIgnoreCase(getAuthorityName(CLAP_CLASS))) { result = CLAP_CLASS; } else if (authority .equalsIgnoreCase(getAuthorityName(CLAP_SYSTEM))) { result = CLAP_SYSTEM; } else if (authority .equalsIgnoreCase(getAuthorityName(CLAP_THREAD))) { result = CLAP_THREAD; } else { result = CLAP_DEFAULT; } } } return result; }
/** * Returns the type of authority. * * @return The type of authority. */ public int getRiapAuthorityType() { int result = 0; if (Protocol.RIAP.equals(getSchemeProtocol())) { final String authority = getAuthority(); if (authority != null) { if (authority .equalsIgnoreCase(getAuthorityName(RIAP_APPLICATION))) { result = RIAP_APPLICATION; } else if (authority .equalsIgnoreCase(getAuthorityName(RIAP_COMPONENT))) { result = RIAP_COMPONENT; } else if (authority .equalsIgnoreCase(getAuthorityName(RIAP_HOST))) { result = RIAP_HOST; } } } return result; }
if (Protocol.FILE.equals(fileRef.getSchemeProtocol())) { final File file = fileRef.getFile(); if (Method.GET.equals(request.getMethod())
@Override public void handle(Request request, Response response) { try { if (Protocol.FTP.equals(request.getProtocol())) { if (Method.GET.equals(request.getMethod())) { Reference ftpRef = request.getResourceRef();
@Override public void handle(Request request, Response response) { try { if (Protocol.FTP.equals(request.getProtocol())) { if (Method.GET.equals(request.getMethod())) { Reference ftpRef = request.getResourceRef();
@Override public void handle(Request request, Response response) { try { if (Protocol.FTP.equals(request.getProtocol())) { if (Method.GET.equals(request.getMethod())) { Reference ftpRef = request.getResourceRef();
Protocol protocol = request.getProtocol(); if (protocol.equals(Protocol.RIAP)) {
if (xmlConfigReference != null) { Protocol protocol = xmlConfigReference.getSchemeProtocol(); if (Protocol.FILE.equals(protocol)) {
if (protocol.equals(Protocol.RIAP)) {