@Override public String getExtension() { return FSEntrySupport.extensionFromName(getName()); }
@Override public String getExtension() { return FSEntrySupport.extensionFromName(getName()); }
@Override public String getExtension() { return FSEntrySupport.extensionFromName(getName()); }
/** * Create a virtual tree hierarchy with a file supporting the leaf. * @param path Position of the file in the hierarchy, including its name * @param file The actual file, or directory , abcking the end leaf * @return The FSEntry root for this hierarchy * @throws Exception Invalid parameter */ static public FSEntry getPositionedFile(String path, File file) throws Exception { List<String> pathFrags = FSEntrySupport.interpretPath(path); // Start at leaf and work our way back int index = pathFrags.size() - 1; FSEntry root = new FSEntryFile(pathFrags.get(index), file); --index; while(index >= 0){ FSEntryVirtualDirectory parent = new FSEntryVirtualDirectory(pathFrags.get(index)); parent.addChildEntry(root); root = parent; --index; } return root; }
@Override public String getExtension() { return FSEntrySupport.extensionFromName(getName()); }
@Override public String getExtension() { return FSEntrySupport.extensionFromName(getName()); }
@Override public InputStream getInputStream() throws Exception { for(FSEntry entry : entries){ InputStream is = entry.getInputStream(); if( null != is ) { return is; } } return null; }
/** * Creates an instance of FSEntryResource to represent an entry based on the resource * specified by the classLoader and resource name. * @param classLoader Class loader used to find the resource * @param resourceName Actual name of resource * @return An entry representing the specified resource. * @throws Exception Invalid request */ static public FSEntryResource create(ClassLoader classLoader, String resourceName) throws Exception { return create(null, classLoader, resourceName); }
@Override public String getExtension() { return FSEntrySupport.extensionFromName(name); }
@Override public boolean isDirectory() { return entries.get(0).isDirectory(); }
@Override public FSEntry getChild(String name) { FSEntry result = null; if( file.exists() && file.isDirectory() ){ File childFile = new File(file,name); if( childFile.exists() ) { result = new FSEntryFile(_Internal.INTERNAL, childFile); } } return result; }
@Override public boolean exists() { for(FSEntry entry : entries){ if( entry.exists() ) { return true; } } return false; }
@Override public FSEntry getChild(String name) { // Accumulate the lists of files for(FSEntry entry : entries){ FSEntry child = entry.getChild(name); if( null != child ){ return child; } } return null; }
@Override public List<FSEntry> getChildren() { return getChildren(FSEntryNameFilter.all); }
@Override public List<FSEntry> getChildren() { return getChildren(FSEntryNameFilter.all); }
@Override public List<FSEntry> getChildren() { return getChildren(FSEntryNameFilter.all); }
@Override public long getSize() throws Exception { return entry.getSize(); }
@Override public List<FSEntry> getChildren() { return getChildren(FSEntryNameFilter.all); }
@Override public InputStream getInputStream() throws Exception { return entry.getInputStream(); }