de.grogra.vfs
Class FileSystem

java.lang.Object
  extended by de.grogra.util.TreeModelSupport
      extended by de.grogra.vfs.FileSystem
All Implemented Interfaces:
javax.swing.tree.TreeModel
Direct Known Subclasses:
FileSystemBase, LocalFileSystem

public abstract class FileSystem
extends TreeModelSupport
implements javax.swing.tree.TreeModel


Nested Class Summary
protected  class FileSystem.Out
           
 
Field Summary
protected  java.net.FileNameMap fileNameMap
           
protected  java.util.jar.Manifest manifest
           
static MimeType MIME_TYPE
           
 
Fields inherited from class de.grogra.util.TreeModelSupport
NODES_CHANGED, NODES_INSERTED, NODES_REMOVED, STRUCTURE_CHANGED
 
Constructor Summary
FileSystem(java.lang.String fsName, java.lang.String protocol)
           
 
Method Summary
 java.lang.Object addLocalFile(java.io.File source, java.lang.Object targetDir, java.lang.String name)
           
 void copyFilesTo(java.util.Collection list, FileSystem fs)
           
 java.lang.Object copyFileTo(java.lang.Object file, FileSystem fs)
           
 void copyFileTo(java.lang.Object file, FileSystem fs, java.lang.Object destFile)
           
 java.lang.Object copyFileToDirectory(java.lang.Object file, FileSystem fs, java.lang.Object destDir)
           
 java.lang.Object copyFileToDirectory(java.lang.Object file, FileSystem fs, java.lang.Object destDir, java.lang.String name)
           
 java.lang.Object create(java.lang.Object parent, java.lang.String name, boolean createDirectory)
           
 java.lang.Object create(java.lang.Object parent, java.lang.String name, boolean createDirectory, boolean ensureNew)
           
protected abstract  java.lang.Object createImpl(java.lang.Object parent, java.lang.String name, boolean createDirectory)
           
abstract  void delete(java.lang.Object file)
           
 boolean equals(java.lang.Object a, java.lang.Object b)
           
protected  java.lang.Object fireInserted(java.lang.Object createImplRet)
           
 java.lang.String getAttribute(java.lang.Object file, java.util.jar.Attributes.Name name)
           
 java.lang.String getAttribute(java.lang.Object file, java.lang.String name)
           
 java.util.jar.Attributes getAttributes(java.lang.Object file, boolean create)
           
 java.nio.charset.Charset getCharset(java.lang.Object file)
           
 java.lang.Object getChild(java.lang.Object parent, int index)
           
 int getChildCount(java.lang.Object file)
           
 javax.swing.event.TreeModelEvent getEventFor(java.lang.Object file)
           
abstract  java.lang.Object getFile(java.lang.Object parent, java.lang.String name)
           
 java.lang.Object getFile(java.lang.String path)
           
static java.lang.Object getFile(javax.swing.event.TreeModelEvent e)
           
 java.lang.String getFSName()
           
 int getIndexOfChild(java.lang.Object parent, java.lang.Object file)
           
abstract  java.io.InputStream getInputStream(java.lang.Object file)
           
 java.util.jar.Manifest getManifest()
           
protected  java.lang.String getManifestName(java.lang.Object file)
           
 MimeType getMimeType(java.lang.Object file)
           
abstract  java.lang.String getName(java.lang.Object file)
           
abstract  java.io.OutputStream getOutputStream(java.lang.Object file, boolean append)
           
abstract  java.lang.Object getParent(java.lang.Object file)
           
 java.lang.String getPath(java.lang.Object file)
           
 java.lang.String getPathWithLeadingSlash(java.lang.Object file)
           
 java.lang.String getProtocol()
           
 java.io.Reader getReader(java.lang.Object file)
           
abstract  java.lang.Object getRoot()
           
abstract  long getSize(java.lang.Object file)
           
abstract  long getTime(java.lang.Object file)
           
 javax.swing.tree.TreePath getTreePath(java.lang.Object file)
           
 java.io.Writer getWriter(java.lang.Object file, boolean append)
           
static boolean isContainedInChildren(java.lang.Object file, javax.swing.event.TreeModelEvent e)
           
abstract  boolean isPersistent()
           
abstract  boolean isReadOnly(java.lang.Object file)
           
abstract  java.lang.Object[] listFiles(java.lang.Object parent)
           
 void readJar(java.io.InputStream in, boolean verify)
           
 void removeNonlistedAttributes(java.util.Collection list)
           
 void setFileNameMap(java.net.FileNameMap map)
           
 void setManifest(java.util.jar.Manifest manifest)
           
 void setMimeType(java.lang.Object file, MimeType t)
           
abstract  void setTime(java.lang.Object file, long time)
           
abstract  java.lang.Object toFile(java.net.URL url)
           
abstract  java.net.URL toURL(java.lang.Object file)
           
 void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object value)
           
 void writeJar(java.io.OutputStream out)
           
 
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 Detail

fileNameMap

protected java.net.FileNameMap fileNameMap

manifest

protected java.util.jar.Manifest manifest

MIME_TYPE

public static final MimeType MIME_TYPE
Constructor Detail

FileSystem

public FileSystem(java.lang.String fsName,
                  java.lang.String protocol)
Method Detail

addLocalFile

public java.lang.Object addLocalFile(java.io.File source,
                                     java.lang.Object targetDir,
                                     java.lang.String name)
                              throws java.io.IOException
Throws:
java.io.IOException

copyFilesTo

public void copyFilesTo(java.util.Collection list,
                        FileSystem fs)
                 throws java.io.IOException
Throws:
java.io.IOException

copyFileTo

public java.lang.Object copyFileTo(java.lang.Object file,
                                   FileSystem fs)
                            throws java.io.IOException
Throws:
java.io.IOException

copyFileTo

public void copyFileTo(java.lang.Object file,
                       FileSystem fs,
                       java.lang.Object destFile)
                throws java.io.IOException
Throws:
java.io.IOException

copyFileToDirectory

public java.lang.Object copyFileToDirectory(java.lang.Object file,
                                            FileSystem fs,
                                            java.lang.Object destDir)
                                     throws java.io.IOException
Throws:
java.io.IOException

copyFileToDirectory

public java.lang.Object copyFileToDirectory(java.lang.Object file,
                                            FileSystem fs,
                                            java.lang.Object destDir,
                                            java.lang.String name)
                                     throws java.io.IOException
Throws:
java.io.IOException

create

public java.lang.Object create(java.lang.Object parent,
                               java.lang.String name,
                               boolean createDirectory)
                        throws java.io.IOException
Throws:
java.io.IOException

create

public java.lang.Object create(java.lang.Object parent,
                               java.lang.String name,
                               boolean createDirectory,
                               boolean ensureNew)
                        throws java.io.IOException
Throws:
java.io.IOException

createImpl

protected abstract java.lang.Object createImpl(java.lang.Object parent,
                                               java.lang.String name,
                                               boolean createDirectory)
                                        throws java.io.IOException
Throws:
java.io.IOException

delete

public abstract void delete(java.lang.Object file)
                     throws java.io.IOException
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object a,
                      java.lang.Object b)

fireInserted

protected java.lang.Object fireInserted(java.lang.Object createImplRet)

getAttribute

public java.lang.String getAttribute(java.lang.Object file,
                                     java.util.jar.Attributes.Name name)

getAttribute

public java.lang.String getAttribute(java.lang.Object file,
                                     java.lang.String name)

getAttributes

public java.util.jar.Attributes getAttributes(java.lang.Object file,
                                              boolean create)

getCharset

public java.nio.charset.Charset getCharset(java.lang.Object file)

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Specified by:
getChild in interface javax.swing.tree.TreeModel

getChildCount

public int getChildCount(java.lang.Object file)
Specified by:
getChildCount in interface javax.swing.tree.TreeModel

getEventFor

public javax.swing.event.TreeModelEvent getEventFor(java.lang.Object file)

getFile

public abstract java.lang.Object getFile(java.lang.Object parent,
                                         java.lang.String name)

getFile

public java.lang.Object getFile(java.lang.String path)

getFile

public static java.lang.Object getFile(javax.swing.event.TreeModelEvent e)

getFSName

public java.lang.String getFSName()

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
                           java.lang.Object file)
Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel

getInputStream

public abstract java.io.InputStream getInputStream(java.lang.Object file)
                                            throws java.io.IOException
Throws:
java.io.IOException

getManifest

public final java.util.jar.Manifest getManifest()

getManifestName

protected java.lang.String getManifestName(java.lang.Object file)

getMimeType

public MimeType getMimeType(java.lang.Object file)

getName

public abstract java.lang.String getName(java.lang.Object file)

getOutputStream

public abstract java.io.OutputStream getOutputStream(java.lang.Object file,
                                                     boolean append)
                                              throws java.io.IOException
Throws:
java.io.IOException

getParent

public abstract java.lang.Object getParent(java.lang.Object file)

getPath

public java.lang.String getPath(java.lang.Object file)

getPathWithLeadingSlash

public final java.lang.String getPathWithLeadingSlash(java.lang.Object file)

getProtocol

public java.lang.String getProtocol()

getReader

public java.io.Reader getReader(java.lang.Object file)
                         throws java.io.IOException
Throws:
java.io.IOException

getRoot

public abstract java.lang.Object getRoot()
Specified by:
getRoot in interface javax.swing.tree.TreeModel

getSize

public abstract long getSize(java.lang.Object file)

getTime

public abstract long getTime(java.lang.Object file)

getTreePath

public javax.swing.tree.TreePath getTreePath(java.lang.Object file)

getWriter

public java.io.Writer getWriter(java.lang.Object file,
                                boolean append)
                         throws java.io.IOException
Throws:
java.io.IOException

isContainedInChildren

public static boolean isContainedInChildren(java.lang.Object file,
                                            javax.swing.event.TreeModelEvent e)

isPersistent

public abstract boolean isPersistent()

isReadOnly

public abstract boolean isReadOnly(java.lang.Object file)

listFiles

public abstract java.lang.Object[] listFiles(java.lang.Object parent)

readJar

public void readJar(java.io.InputStream in,
                    boolean verify)
             throws java.io.IOException
Throws:
java.io.IOException

removeNonlistedAttributes

public void removeNonlistedAttributes(java.util.Collection list)

setFileNameMap

public void setFileNameMap(java.net.FileNameMap map)

setManifest

public void setManifest(java.util.jar.Manifest manifest)

setMimeType

public void setMimeType(java.lang.Object file,
                        MimeType t)

setTime

public abstract void setTime(java.lang.Object file,
                             long time)

toFile

public abstract java.lang.Object toFile(java.net.URL url)

toURL

public abstract java.net.URL toURL(java.lang.Object file)

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath path,
                                java.lang.Object value)
Specified by:
valueForPathChanged in interface javax.swing.tree.TreeModel

writeJar

public void writeJar(java.io.OutputStream out)
              throws java.io.IOException
Throws:
java.io.IOException