com.partnersoft.workbench.app
Class WorkbenchFileLogic

java.lang.Object
  extended by com.partnersoft.workbench.app.WorkbenchFileLogic

public class WorkbenchFileLogic
extends java.lang.Object


Constructor Summary
WorkbenchFileLogic(WorkbenchApp workbench)
           
 
Method Summary
 void copy(VfsDirectory from, VfsDirectory to)
           
 void copy(VfsFile from, VfsFile to)
           
 void copyAndEdit(VfsDirectory from, VfsDirectory to)
           
 void copyAndEdit(VfsFile from, VfsFile to)
           
 void createAndEditMapset(VfsDirectory directory)
           
 void createMapset(VfsDirectory directory)
           
 void directoryStructureChanged(VfsDirectory node)
           
 void edit(VfsNode node)
           
 java.lang.String endTransaction()
           
 void filterCsv()
          Filters a CSV file.
 VfsDirectory getCurrentDirectory()
           
 VfsFile getCurrentFile()
           
 VfsNode getCurrentNode()
           
 void importAndEditDirectory(VfsDirectory source, VfsDirectory destination)
           
 void importAndEditFile(VfsFile source, VfsFile destination)
           
 void importDirectory(VfsDirectory source, VfsDirectory destination)
           
 void importFile(VfsFile source, VfsFile destination)
           
 void importFiles(java.util.List<VfsFile> files, VfsDirectory destination)
           
 boolean inTransaction()
           
 java.util.List<WorkbenchDirectoryEditor> listEditorsFor(VfsDirectory Directory)
           
 java.util.List<WorkbenchFileEditor> listEditorsFor(VfsFile file)
           
 java.util.List<WorkbenchDirectoryHandler> listHandlersFor(VfsDirectory Directory)
           
 java.util.List<WorkbenchFileHandler> listHandlersFor(VfsFile file)
           
 java.util.List<VfsNode> listNodesForGlob(java.lang.String glob)
           
 void load()
          Reload the currently edited file.
 Cog loadCogFrom(VfsFile file)
          Loads a cog from the given file; assumes it is Cog XML format.
 java.lang.Object loadObjectFrom(VfsFile file)
          Loads an object from the given file; assumes it is Cog XML format.
 VfsDirectory makeAndEditDirectory(VfsDirectory directory)
           
 VfsFile makeAndEditFile(VfsFile file)
           
 VfsFile makeAndEditFile(VfsFile file, java.lang.String contents)
           
 VfsFile makeAndEditFile(VfsFile file, VfsFile example)
           
 void makeAndEditModule(VfsDirectory directory)
           
 VfsDirectory makeDirectory(VfsDirectory directory)
           
 VfsFile makeFile(VfsFile file)
           
 VfsFile makeFile(VfsFile file, java.lang.String contents)
           
 VfsFile makeFile(VfsFile file, VfsFile example)
           
 void makeModule(VfsDirectory directory)
           
 void move(VfsDirectory from, VfsDirectory to)
           
 void move(VfsFile from, VfsFile to)
           
 void moveAndEdit(VfsDirectory from, VfsDirectory to)
           
 void moveAndEdit(VfsFile from, VfsFile to)
           
 void nodeChanged(VfsNode node)
           
 VfsNode nodeFor(Path path)
           
 VfsNode nodeFor(java.lang.String path)
           
 void nodeInserted(VfsNode node)
           
 void nodeRemoved(VfsNode node)
           
 void packBoxcar()
          Packs up the current selection into a boxcar.gz in the current selection's directory.
 void packBoxcar(VfsFile boxcarFile, java.lang.Iterable<VfsNode> nodes)
           
 void packZip()
          Zips up the current selection into the current selection's directory.
 void packZip(VfsFile zipFile, java.lang.Iterable<VfsNode> nodes)
           
 void remove()
           
 void remove(Path path)
           
 void remove(java.lang.String path)
           
 void remove(VfsNode node)
           
 void removeDirectory(VfsDirectory directory)
           
 void removeFile(VfsFile file)
           
 void removeSelectedNode()
           
 void save()
          Save the currently edited file.
 void saveCogTo(Cog wotnot, VfsFile file)
          Saves a cog to the given file, assumes Cog XML format.
 void saveObjectTo(java.lang.Object wotnot, VfsFile file)
          Saves an object to the given file, assumes Cog XML format.
 void setHeapSize()
           
 java.lang.String startTransaction()
           
 void treeChanged()
          This is the most brute-force event to indicate that the filesystem has changed; it refreshes the entire tree.
 void unpackBoxcar()
          Unpacks the currently-selected boxcar into the same directory it's in.
 void unpackBoxcar(VfsFile boxcarFile, VfsDirectory directory)
           
 void unpackZip()
          Unpacks the currently-selected zip into the same directory it's in.
 void unpackZip(VfsFile zipFile, VfsDirectory directory)
           
 void vfsChanged()
           
 void zipUpConfig()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkbenchFileLogic

public WorkbenchFileLogic(WorkbenchApp workbench)
Method Detail

save

public void save()
Save the currently edited file. This is a good idea before launching apps or closing the program.


load

public void load()
Reload the currently edited file. This is a good idea before launching apps or closing the program.


treeChanged

public void treeChanged()
                 throws java.io.IOException
This is the most brute-force event to indicate that the filesystem has changed; it refreshes the entire tree.

Throws:
java.io.IOException

nodeChanged

public void nodeChanged(VfsNode node)
                 throws java.io.IOException
Throws:
java.io.IOException

nodeRemoved

public void nodeRemoved(VfsNode node)
                 throws java.io.IOException
Throws:
java.io.IOException

nodeInserted

public void nodeInserted(VfsNode node)
                  throws java.io.IOException
Throws:
java.io.IOException

directoryStructureChanged

public void directoryStructureChanged(VfsDirectory node)
                               throws java.io.IOException
Throws:
java.io.IOException

vfsChanged

public void vfsChanged()
                throws java.io.IOException
Throws:
java.io.IOException

makeFile

public VfsFile makeFile(VfsFile file)
                 throws java.io.IOException
Throws:
java.io.IOException

makeFile

public VfsFile makeFile(VfsFile file,
                        java.lang.String contents)
                 throws java.io.IOException
Throws:
java.io.IOException

makeFile

public VfsFile makeFile(VfsFile file,
                        VfsFile example)
                 throws java.io.IOException
Throws:
java.io.IOException

makeAndEditFile

public VfsFile makeAndEditFile(VfsFile file)
                        throws java.io.IOException
Throws:
java.io.IOException

makeAndEditFile

public VfsFile makeAndEditFile(VfsFile file,
                               java.lang.String contents)
                        throws java.io.IOException
Throws:
java.io.IOException

makeAndEditFile

public VfsFile makeAndEditFile(VfsFile file,
                               VfsFile example)
                        throws java.io.IOException
Throws:
java.io.IOException

makeDirectory

public VfsDirectory makeDirectory(VfsDirectory directory)
                           throws java.io.IOException
Throws:
java.io.IOException

makeAndEditDirectory

public VfsDirectory makeAndEditDirectory(VfsDirectory directory)
                                  throws java.io.IOException
Throws:
java.io.IOException

makeAndEditModule

public void makeAndEditModule(VfsDirectory directory)
                       throws java.io.IOException
Throws:
java.io.IOException

makeModule

public void makeModule(VfsDirectory directory)
                throws java.io.IOException
Throws:
java.io.IOException

removeDirectory

public void removeDirectory(VfsDirectory directory)
                     throws java.io.IOException
Throws:
java.io.IOException

removeFile

public void removeFile(VfsFile file)
                throws java.io.IOException
Throws:
java.io.IOException

importFile

public void importFile(VfsFile source,
                       VfsFile destination)
                throws java.io.IOException
Throws:
java.io.IOException

importAndEditFile

public void importAndEditFile(VfsFile source,
                              VfsFile destination)
                       throws java.io.IOException
Throws:
java.io.IOException

importFiles

public void importFiles(java.util.List<VfsFile> files,
                        VfsDirectory destination)
                 throws java.io.IOException
Throws:
java.io.IOException

importDirectory

public void importDirectory(VfsDirectory source,
                            VfsDirectory destination)
                     throws java.io.IOException
Throws:
java.io.IOException

importAndEditDirectory

public void importAndEditDirectory(VfsDirectory source,
                                   VfsDirectory destination)
                            throws java.io.IOException
Throws:
java.io.IOException

listHandlersFor

public java.util.List<WorkbenchFileHandler> listHandlersFor(VfsFile file)

listEditorsFor

public java.util.List<WorkbenchFileEditor> listEditorsFor(VfsFile file)

listHandlersFor

public java.util.List<WorkbenchDirectoryHandler> listHandlersFor(VfsDirectory Directory)

listEditorsFor

public java.util.List<WorkbenchDirectoryEditor> listEditorsFor(VfsDirectory Directory)

removeSelectedNode

public void removeSelectedNode()
                        throws java.io.IOException
Throws:
java.io.IOException

remove

public void remove(VfsNode node)
            throws java.io.IOException
Throws:
java.io.IOException

remove

public void remove(java.lang.String path)
            throws java.io.IOException
Throws:
java.io.IOException

remove

public void remove(Path path)
            throws java.io.IOException
Throws:
java.io.IOException

remove

public void remove()
            throws java.io.IOException
Throws:
java.io.IOException

getCurrentNode

public VfsNode getCurrentNode()

getCurrentFile

public VfsFile getCurrentFile()

getCurrentDirectory

public VfsDirectory getCurrentDirectory()

nodeFor

public VfsNode nodeFor(Path path)
                throws java.io.IOException
Throws:
java.io.IOException

nodeFor

public VfsNode nodeFor(java.lang.String path)
                throws java.io.IOException
Throws:
java.io.IOException

listNodesForGlob

public java.util.List<VfsNode> listNodesForGlob(java.lang.String glob)
                                         throws java.io.IOException
Throws:
java.io.IOException

inTransaction

public boolean inTransaction()

startTransaction

public java.lang.String startTransaction()
                                  throws java.io.IOException
Throws:
java.io.IOException

endTransaction

public java.lang.String endTransaction()
                                throws java.io.IOException
Throws:
java.io.IOException

moveAndEdit

public void moveAndEdit(VfsFile from,
                        VfsFile to)
                 throws java.io.IOException
Throws:
java.io.IOException

move

public void move(VfsFile from,
                 VfsFile to)
          throws java.io.IOException
Throws:
java.io.IOException

copyAndEdit

public void copyAndEdit(VfsFile from,
                        VfsFile to)
                 throws java.io.IOException
Throws:
java.io.IOException

copy

public void copy(VfsFile from,
                 VfsFile to)
          throws java.io.IOException
Throws:
java.io.IOException

moveAndEdit

public void moveAndEdit(VfsDirectory from,
                        VfsDirectory to)
                 throws java.io.IOException
Throws:
java.io.IOException

move

public void move(VfsDirectory from,
                 VfsDirectory to)
          throws java.io.IOException
Throws:
java.io.IOException

copyAndEdit

public void copyAndEdit(VfsDirectory from,
                        VfsDirectory to)
                 throws java.io.IOException
Throws:
java.io.IOException

copy

public void copy(VfsDirectory from,
                 VfsDirectory to)
          throws java.io.IOException
Throws:
java.io.IOException

edit

public void edit(VfsNode node)

unpackBoxcar

public void unpackBoxcar()
Unpacks the currently-selected boxcar into the same directory it's in.


unpackBoxcar

public void unpackBoxcar(VfsFile boxcarFile,
                         VfsDirectory directory)
                  throws java.io.IOException
Throws:
java.io.IOException

packBoxcar

public void packBoxcar()
Packs up the current selection into a boxcar.gz in the current selection's directory.


packBoxcar

public void packBoxcar(VfsFile boxcarFile,
                       java.lang.Iterable<VfsNode> nodes)
                throws java.io.IOException
Throws:
java.io.IOException

unpackZip

public void unpackZip()
Unpacks the currently-selected zip into the same directory it's in.


unpackZip

public void unpackZip(VfsFile zipFile,
                      VfsDirectory directory)
               throws java.io.IOException
Throws:
java.io.IOException

packZip

public void packZip()
Zips up the current selection into the current selection's directory.


packZip

public void packZip(VfsFile zipFile,
                    java.lang.Iterable<VfsNode> nodes)
             throws java.io.IOException
Throws:
java.io.IOException

createMapset

public void createMapset(VfsDirectory directory)
                  throws java.io.IOException
Throws:
java.io.IOException

createAndEditMapset

public void createAndEditMapset(VfsDirectory directory)
                         throws java.io.IOException
Throws:
java.io.IOException

loadObjectFrom

public java.lang.Object loadObjectFrom(VfsFile file)
                                throws java.io.IOException
Loads an object from the given file; assumes it is Cog XML format.

Returns:
Throws:
java.io.IOException

saveObjectTo

public void saveObjectTo(java.lang.Object wotnot,
                         VfsFile file)
                  throws java.io.IOException
Saves an object to the given file, assumes Cog XML format.

Throws:
java.io.IOException

loadCogFrom

public Cog loadCogFrom(VfsFile file)
                throws java.io.IOException
Loads a cog from the given file; assumes it is Cog XML format.

Returns:
Throws:
java.io.IOException

saveCogTo

public void saveCogTo(Cog wotnot,
                      VfsFile file)
               throws java.io.IOException
Saves a cog to the given file, assumes Cog XML format.

Throws:
java.io.IOException

filterCsv

public void filterCsv()
Filters a CSV file.


setHeapSize

public void setHeapSize()

zipUpConfig

public void zipUpConfig()