/** * Checks for entry. * * @return true, if successful */ public boolean hasEntry() { String path = this.uri.getRawSchemeSpecificPart(); if (this.isBundleresource()) { return path.substring(2).contains("/"); } return path.contains("!"); }
/** * Gets the entry. If no entry can be found an empty string is returned now. * This behaviour has changed with 1.5. * * @return the entry */ public String getEntry() { if (this.hasEntry()) { String path = this.uri.getRawSchemeSpecificPart(); if (this.isBundleresource()) { return StringUtils.substringAfter(path.substring(2), "/"); } else { String entry = StringUtils.substringAfterLast(path, "!"); return (entry.charAt(0) == '/') ? entry.substring(1) : entry; } } else { return ""; } }