Package org.jboss.as.jdr.util
Class JdrZipFile
- java.lang.Object
-
- org.jboss.as.jdr.util.JdrZipFile
-
public class JdrZipFile extends Object
Abstracts the zipfile used for packaging the JDR Report.
-
-
Constructor Summary
Constructors Constructor Description JdrZipFile(JdrEnvironment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(InputStream is, String path)Adds the contents of theInputStreamto the path in the zip.voidadd(String content, String path)Adds content to the zipfile at path path is prepended with the directory reserved for generated text files in JDRvoidadd(org.jboss.vfs.VirtualFile file, InputStream is)Adds the content of theInputStreamto the zip in a location that mirrors wherefileis located.voidaddAsString(InputStream stream, String path)Adds content to the zipfile at path path is prepended with the directory reserved for generated text files in JDRvoidaddLog(String content, String logName)Adds content to the zipfile in a file named logName path is prepended with the directory reserved for JDR log filesvoidclose()StringgetProductDirName()Stringname()
-
-
-
Constructor Detail
-
JdrZipFile
public JdrZipFile(JdrEnvironment env) throws Exception
- Throws:
Exception
-
-
Method Detail
-
name
public String name()
- Returns:
- the full pathname to the zipfile on disk
-
add
public void add(InputStream is, String path)
Adds the contents of theInputStreamto the path in the zip. This method allows for absolute control of the destination of the content to be stored. It is not common to use this method.- Parameters:
is- content to writepath- destination to write to in the zip file
-
add
public void add(org.jboss.vfs.VirtualFile file, InputStream is) throws ExceptionAdds the content of theInputStreamto the zip in a location that mirrors wherefileis located. For example iffileis at/tmp/foo/barand$JBOSS_HOMEistmpthen the destination will beJBOSSHOME/foo/bar- Parameters:
file-VirtualFilewhere metadata is read fromis- content to write to the zip file- Throws:
Exception
-
add
public void add(String content, String path) throws Exception
Adds content to the zipfile at path path is prepended with the directory reserved for generated text files in JDR- Parameters:
content-path-- Throws:
Exception
-
addAsString
public void addAsString(InputStream stream, String path) throws Exception
Adds content to the zipfile at path path is prepended with the directory reserved for generated text files in JDR- Parameters:
stream-path-- Throws:
Exception
-
getProductDirName
public String getProductDirName()
-
addLog
public void addLog(String content, String logName) throws Exception
Adds content to the zipfile in a file named logName path is prepended with the directory reserved for JDR log files- Parameters:
content-logName-- Throws:
Exception
-
-