|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas_ws.wsgen.jarfile.JarManager
Manage a jar file.
Field Summary | |
protected java.lang.String |
filename
original jar filename |
protected static org.objectweb.util.monolog.api.Logger |
logger
The logger to use |
protected java.util.Map |
newEntries
Map (Entry->File) |
protected java.lang.String |
outDir
output directory |
Constructor Summary | |
JarManager(java.lang.String jarFilename)
Build a new instance of a JarManager. |
|
JarManager(java.lang.String jarFilename,
java.lang.String destDir)
Build an instance of JarManager. |
Method Summary | |
void |
addDir(java.io.File dir)
Add all Files contained in a directory in the current jar file. |
void |
addDir(java.lang.String base,
java.io.File dir)
Add all Files contained in a directory in the current jar file. |
void |
addDir(java.lang.String base,
java.io.File dir,
java.lang.String ends)
Add Files contained in a directory in the current jar file at the specified entryName location. |
void |
addFile(java.lang.String entryName,
java.io.File file)
Add a new File in the current jar file. |
protected void |
addXml(java.lang.String name,
org.objectweb.jonas_ws.wsgen.xml.Xml xml)
Add an Xml object to be marshalled when saving. |
void |
close()
Delete the copy |
void |
finalize()
When instance destructed, close the Streams. |
java.lang.String |
getFilename()
Return the filename managed. |
java.lang.String |
getOutFilename()
Return the filename of the destination file. |
protected static java.lang.String |
getSAXMsg(java.lang.String fileName,
org.xml.sax.SAXParseException exception,
java.lang.String msg)
build a message from SAX Exception in a consistent style, consistent with emacs compile mode (same as grep, cc, javac, etc). |
protected boolean |
isNewFile()
Return true if a new jar file has been created. |
protected boolean |
omit(java.lang.String name)
Omit filename yes/no ?. |
void |
save()
Add all jar entries in the jar file. |
void |
setOutputDir(java.lang.String dir)
|
protected static void |
writeEntry(java.lang.String en,
java.io.InputStream is,
java.util.jar.JarOutputStream jos)
write a new entry in the jar output stream. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String filename
protected java.lang.String outDir
protected java.util.Map newEntries
protected static org.objectweb.util.monolog.api.Logger logger
Constructor Detail |
public JarManager(java.lang.String jarFilename, java.lang.String destDir) throws WsGenException
jarFilename
- the name of the jar file
that we want to manage.destDir
- the name of the directory where final file will be created.
WsGenException
- if the jar cannot be createdpublic JarManager(java.lang.String jarFilename) throws WsGenException
jarFilename
- the name of the jar file
that we want to manage.
WsGenException
- if jar cannot be createdMethod Detail |
public java.lang.String getFilename()
public java.lang.String getOutFilename()
public void setOutputDir(java.lang.String dir) throws WsGenException
WsGenException
public void addDir(java.io.File dir) throws WsGenException
dir
- the directory to add
WsGenException
- when IOExceptio occurs?public void addDir(java.lang.String base, java.io.File dir) throws WsGenException
base
- entry base name.dir
- the directory to add.
WsGenException
- when IOException occurspublic void addDir(java.lang.String base, java.io.File dir, java.lang.String ends) throws WsGenException
base
- where to put directory files in the jardir
- the directory to addends
- the filename accept pattern
WsGenException
- when IOException occurspublic void addFile(java.lang.String entryName, java.io.File file) throws WsGenException
entryName
- where to put the file in the jarfile
- the file to add
WsGenException
- when IOException occursprotected static java.lang.String getSAXMsg(java.lang.String fileName, org.xml.sax.SAXParseException exception, java.lang.String msg)
fileName
- name of the fileexception
- the SAX exceptionmsg
- the string message
protected boolean isNewFile()
protected static void writeEntry(java.lang.String en, java.io.InputStream is, java.util.jar.JarOutputStream jos) throws WsGenException
en
- the entry nameis
- the input stream to read.jos
- the output stream to write.
WsGenException
- when writing entry fails.public void save() throws WsGenException
WsGenException
- when save fails.public void close()
public void finalize()
protected boolean omit(java.lang.String name)
name
- name of entry to be tested
protected void addXml(java.lang.String name, org.objectweb.jonas_ws.wsgen.xml.Xml xml)
name
- entry name.xml
- the Xml object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |