java.lang.Object
de.grogra.util.TreeModelSupport
de.grogra.vfs.FileSystem
- All Implemented Interfaces:
TreeModel
- Direct Known Subclasses:
FileSystemBase,LocalFileSystem
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class de.grogra.util.TreeModelSupport
NODES_CHANGED, NODES_INSERTED, NODES_REMOVED, STRUCTURE_CHANGED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLocalFile(Object source, Object targetDir, String name) addLocalFile(Object source, Object targetDir, String name, boolean createDir) addLocalFile(Object source, Object targetDir, String name, boolean createDir, boolean ensureNew) Object[]completeListFiles(Object parent) Loop over all files and their children to get all files, including in subrepositories from the parent.voidcopyFilesTo(Collection list, FileSystem fs) copyFileTo(Object file, FileSystem fs) voidcopyFileTo(Object file, FileSystem fs, Object destFile) copyFileToDirectory(Object file, FileSystem fs, Object destDir) copyFileToDirectory(Object file, FileSystem fs, Object destDir, String name) createIfDoesntExist(Object parent, Object[] path, boolean isDirectory, boolean ensureNew) Get a file/memory entry Or create it including all parent directories up to the ResourceDircreateIfDoesntExist(Object parent, Object file, boolean isDirectory, boolean ensureNew) createIfDoesntExist(Object parent, String path, boolean isDirectory, boolean ensureNew) protected abstract ObjectcreateImpl(Object parent, String name, boolean createDirectory) abstract voidensureNewDir(Object parent, String name) Check if another directory has the same name in the parentensureNewFile(Object parent, String name) Check at the root of the filesystem if another file has the same FileName basename is the file name (i.e.booleanReturn all the systemId of file with the given name recursively to the given parentprotected ObjectfireInserted(Object createImplRet) getAbsolutePath(Object file) getAttribute(Object file, String name) getAttribute(Object file, Attributes.Name name) getAttributes(Object file, boolean create) getBaseName(Object file) getBaseName(String name) getCharset(Object file) intgetChildCount(Object file) getEventFor(Object file) abstract Objectstatic ObjectintgetIndexOfChild(Object parent, Object file) abstract InputStreamgetInputStream(Object file) final Manifestprotected StringgetManifestName(Object file) getMimeType(Object file) abstract Stringabstract OutputStreamgetOutputStream(Object file, boolean append) abstract Objectfinal Stringabstract ObjectgetRoot()abstract longabstract longgetTreePath(Object file) static booleanisContainedInChildren(Object file, TreeModelEvent e) booleanisDirectory(Object file) booleanabstract booleanabstract booleanisReadOnly(Object file) abstract Object[]voidreadJar(InputStream in, boolean verify) abstract voidRemove a file from the filesystem.voidvoidvoidsetManifest(Manifest manifest) voidsetMimeType(Object file, MimeType t) abstract voidabstract Objectabstract URLvoidvalueForPathChanged(TreePath path, Object value) voidwriteJar(OutputStream out) voidwriteJar(JarOutputStream out, byte[] buf, Object file, ObjectToBoolean<Object> filter) Methods inherited from class de.grogra.util.TreeModelSupport
addTreeModelListener, allListenersRemoved, clearListeners, fireTreeModelEvent, fireTreeModelEvent, fireTreeModelEvent, fireTreeModelEvent, firstListenerAdded, hasListeners, removeTreeModelListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, isLeaf, removeTreeModelListener
-
Field Details
-
MIME_TYPE
-
fileNameMap
-
manifest
-
-
Constructor Details
-
FileSystem
-
-
Method Details
-
getFSName
-
getProtocol
-
isPersistent
public abstract boolean isPersistent() -
delete
- Throws:
IOException
-
getName
-
toURL
-
toFile
-
getParent
-
isReadOnly
-
getTime
-
setTime
-
getSize
-
getRoot
-
listFiles
-
getFile
-
remove
Remove a file from the filesystem. It does not delete it if its local- Parameters:
file-- Throws:
IOException
-
equals
-
create
- Parameters:
parent- parent is a Entry object in memory file system/ a File in localfilesystemname-createDirectory-- Returns:
- Throws:
IOException
-
create
public Object create(Object parent, String name, boolean createDirectory, boolean ensureNew) throws IOException - Throws:
IOException
-
ensureNewFile
Check at the root of the filesystem if another file has the same FileName basename is the file name (i.e. /dir1/dir2/files.rgg -> basename is "files.rgg", while base is "files" and ext is ".rgg".- Parameters:
parent- a File or an Entryname-- Returns:
-
getBaseName
-
getBaseName
-
completeListFiles
Loop over all files and their children to get all files, including in subrepositories from the parent. Note that directories are files.- Parameters:
parent-- Returns:
-
ensureNewDir
Check if another directory has the same name in the parent- Parameters:
parent- a File or an Entryname-- Returns:
-
createImpl
protected abstract Object createImpl(Object parent, String name, boolean createDirectory) throws IOException - Throws:
IOException
-
fireInserted
-
getInputStream
- Throws:
IOException
-
getOutputStream
- Throws:
IOException
-
getReader
- Throws:
IOException
-
getWriter
- Throws:
IOException
-
getCharset
-
setFileNameMap
-
getMimeType
-
setMimeType
-
setManifest
-
getManifest
-
getFile
-
getPath
-
getAbsolutePath
-
getPathWithLeadingSlash
-
getTreePath
-
getEventFor
-
getChildCount
- Specified by:
getChildCountin interfaceTreeModel
-
getIndexOfChild
- Specified by:
getIndexOfChildin interfaceTreeModel
-
getChild
-
isContainedInChildren
-
getFile
-
getAttributes
-
getAttribute
-
getAttribute
-
getManifestName
-
readJar
- Throws:
IOException
-
writeJar
- Throws:
IOException
-
writeJar
public void writeJar(JarOutputStream out, byte[] buf, Object file, ObjectToBoolean<Object> filter) throws IOException - Throws:
IOException
-
copyFilesTo
- Throws:
IOException
-
copyFileTo
- Throws:
IOException
-
copyFileTo
- Throws:
IOException
-
copyFileToDirectory
- Throws:
IOException
-
copyFileToDirectory
public Object copyFileToDirectory(Object file, FileSystem fs, Object destDir, String name) throws IOException - Throws:
IOException
-
isDirectory
-
addLocalFile
- Throws:
IOException
-
addLocalFile
public Object addLocalFile(Object source, Object targetDir, String name, boolean createDir) throws IOException - Throws:
IOException
-
addLocalFile
public Object addLocalFile(Object source, Object targetDir, String name, boolean createDir, boolean ensureNew) throws IOException - Throws:
IOException
-
addFile
public Object addFile(Object source, Object targetDir, String name, boolean createDir) throws IOException - Parameters:
source- is a FIle or a memory EntrytargetDir- is a File or a memory Entryname-createDir-- Returns:
- Throws:
IOException
-
addFile
public Object addFile(Object source, Object targetDir, String name, boolean createDir, boolean ensureNew) throws IOException - Throws:
IOException
-
removeNonlistedAttributes
-
createIfDoesntExist
public Object createIfDoesntExist(Object parent, Object[] path, boolean isDirectory, boolean ensureNew) throws IOException Get a file/memory entry Or create it including all parent directories up to the ResourceDir- Parameters:
parent- File to getpath- An String array of the kind [foo, bar, New dir] (for a path like /foo/bar/New dir)isDirectory- True if parent is a directoryensureNew- True if parent needs to be new (i.e. if a parent already exist in the path, it will create parent 2)- Returns:
- Throws:
IOException
-
createIfDoesntExist
public Object createIfDoesntExist(Object parent, String path, boolean isDirectory, boolean ensureNew) throws IOException - Throws:
IOException
-
createIfDoesntExist
public Object createIfDoesntExist(Object parent, Object file, boolean isDirectory, boolean ensureNew) throws IOException - Throws:
IOException
-
valueForPathChanged
- Specified by:
valueForPathChangedin interfaceTreeModel
-
isIn
-
findAll
Return all the systemId of file with the given name recursively to the given parent
-