|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dscopesi.djar.DJarArchive
A Bean that implements a Jar(or Zip) archive. Use it with a DJarDirTree and a DJarEntryTable for powerful functionality.
DJarDirTree
,
DJarEntryTable
,
DJarAttribsViewer
Constructor Summary | |
DJarArchive()
Constructs a DJarArchive that is not bound to a file. |
Method Summary | |
void |
addDJarListener(DJarListener l)
Adds a listener of DJarEvent |
long |
extract(java.util.Enumeration entries,
java.io.File destination,
boolean extractWithPath)
Extracts multiple entries. |
boolean |
extract(java.util.jar.JarEntry e,
java.io.File destination,
boolean extractWithPath)
Extracts the single entry. |
long |
extract(java.lang.String archivePath,
java.io.File destination,
boolean extractWithPath,
boolean scanSubFolders)
Extracts all the entries that are in a folder of the archive |
protected void |
fireDataChanged(DJarEvent e)
Fires a DJarEvent to all listeners |
javax.swing.tree.TreeNode |
getDirectoryTree()
Returns the root nod of the directory tree of the archive |
java.util.Enumeration |
getEntries()
Returns all the entries in the archive (an Enumeration of JarEntry) |
java.util.Vector |
getEntriesInPath(java.lang.String path,
boolean scanSubFolders)
Given a path in the archive, returns all the entries in that path. |
java.util.jar.JarEntry |
getEntry(java.lang.String name)
Returns the named entry |
static java.lang.String |
getEntryFileName(java.util.jar.JarEntry entry)
Removes tha path from a JarEntry name |
java.util.jar.JarFile |
getFile()
The JarFile in use |
java.lang.String |
getFileName()
The name of the JarFile in use |
protected void |
readDirectoryTree()
Scans all the archive to build the tree |
void |
removeDJarListener(DJarListener l)
Removes a listener of DJarEvent |
void |
setFile(java.io.File file)
Open the file as a JarFile, scan it and refreshes everything |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DJarArchive()
setFile
to open a file.setFile
Method Detail |
public java.util.jar.JarFile getFile()
public void setFile(java.io.File file) throws java.io.IOException
public java.lang.String getFileName()
public void removeDJarListener(DJarListener l)
DJarEvent
public void addDJarListener(DJarListener l)
DJarEvent
protected void fireDataChanged(DJarEvent e)
public java.util.Enumeration getEntries()
JarEntry
public java.util.jar.JarEntry getEntry(java.lang.String name)
public javax.swing.tree.TreeNode getDirectoryTree()
protected void readDirectoryTree()
public java.util.Vector getEntriesInPath(java.lang.String path, boolean scanSubFolders)
JarEntry
public static java.lang.String getEntryFileName(java.util.jar.JarEntry entry)
public boolean extract(java.util.jar.JarEntry e, java.io.File destination, boolean extractWithPath) throws java.io.IOException
e
- the entry to extractdestination
- the destination path in the file systemextractWithPath
- extracts the entry with its full path (create if necessary)public long extract(java.util.Enumeration entries, java.io.File destination, boolean extractWithPath) throws java.io.IOException
entries
- the entries to extractdestination
- the destination path in the file systemextractWithPath
- extracts the entries with their full path (create if necessary)public long extract(java.lang.String archivePath, java.io.File destination, boolean extractWithPath, boolean scanSubFolders) throws java.io.IOException
archivePath
- the path to the entries to extractdestination
- the destination path in the file systemextractWithPath
- extracts the entries with their full path (create if necessary)scanSubFolders
- extracts entries from subfolders of archivePath
, too
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |