@Override public int getNumBytes() { File fullPath = codeBase.getFullPathOfResource(realResourceName); // this is not needed but causes slowdown on a slow file system IO // file.length() returns zero if not found, and matches the contract of // this method // if (!fullPath.exists()) { // return -1; // } return (int) fullPath.length(); }
InputStream openFile(String resourceName) throws FileNotFoundException, IOException { File path = getFullPathOfResource(resourceName); return new BufferedInputStream(new FileInputStream(path)); }
@Override public ICodeBaseEntry lookupResource(String resourceName) { // Translate resource name, in case a resource name // has been overridden and the resource is being accessed // using the overridden name. resourceName = translateResourceName(resourceName); File file = getFullPathOfResource(resourceName); if (!file.exists()) { return null; } return new DirectoryCodeBaseEntry(this, resourceName); }
@Override public int getNumBytes() { File fullPath = codeBase.getFullPathOfResource(realResourceName); // this is not needed but causes slowdown on a slow file system IO // file.length() returns zero if not found, and matches the contract of // this method // if (!fullPath.exists()) { // return -1; // } return (int) fullPath.length(); }
InputStream openFile(String resourceName) throws FileNotFoundException, IOException { File path = getFullPathOfResource(resourceName); return new BufferedInputStream(new FileInputStream(path)); }
@Override public ICodeBaseEntry lookupResource(String resourceName) { // Translate resource name, in case a resource name // has been overridden and the resource is being accessed // using the overridden name. resourceName = translateResourceName(resourceName); File file = getFullPathOfResource(resourceName); if (!file.exists()) { return null; } return new DirectoryCodeBaseEntry(this, resourceName); }