java.lang.Object
de.grogra.util.TreeModelSupport
de.grogra.vfs.FileSystem
- All Implemented Interfaces:
TreeModel
- Direct Known Subclasses:
FileSystemBase
,LocalFileSystem
-
Nested Class Summary
-
Field Summary
Fields inherited from class de.grogra.util.TreeModelSupport
NODES_CHANGED, NODES_INSERTED, NODES_REMOVED, STRUCTURE_CHANGED
-
Constructor Summary
-
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.void
copyFilesTo
(Collection list, FileSystem fs) copyFileTo
(Object file, FileSystem fs) void
copyFileTo
(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 Object
createImpl
(Object parent, String name, boolean createDirectory) abstract void
ensureNewDir
(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.boolean
protected Object
fireInserted
(Object createImplRet) 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) int
getChildCount
(Object file) getEventFor
(Object file) abstract Object
static Object
int
getIndexOfChild
(Object parent, Object file) abstract InputStream
getInputStream
(Object file) final Manifest
protected String
getManifestName
(Object file) getMimeType
(Object file) abstract String
abstract OutputStream
getOutputStream
(Object file, boolean append) abstract Object
final String
abstract Object
getRoot()
abstract long
abstract long
getTreePath
(Object file) static boolean
isContainedInChildren
(Object file, TreeModelEvent e) boolean
isDirectory
(Object file) boolean
abstract boolean
abstract boolean
isReadOnly
(Object file) abstract Object[]
void
readJar
(InputStream in, boolean verify) abstract void
Remove a file from the filesystem.void
void
void
setManifest
(Manifest manifest) void
setMimeType
(Object file, MimeType t) abstract void
abstract Object
abstract URL
void
valueForPathChanged
(TreePath path, Object value) void
writeJar
(OutputStream out) void
writeJar
(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, removeTreeModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-
getPathWithLeadingSlash
-
getTreePath
-
getEventFor
-
getChildCount
- Specified by:
getChildCount
in interfaceTreeModel
-
getIndexOfChild
- Specified by:
getIndexOfChild
in 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:
valueForPathChanged
in interfaceTreeModel
-
isIn
-