- java.lang.Object
-
- com.ibm.dtfj.utils.file.FileManager
-
- com.ibm.dtfj.utils.file.SimpleFileManager
-
- com.ibm.dtfj.utils.file.CompressedFileManager
-
- Direct Known Subclasses:
GZipFileManager
,ZipFileManager
public abstract class CompressedFileManager extends SimpleFileManager
Abstract class for handling compressed files
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
buffer
-
Fields declared in class com.ibm.dtfj.utils.file.SimpleFileManager
managedFile
-
Fields declared in class com.ibm.dtfj.utils.file.FileManager
logger, MIN_CORE_SIZE
-
-
Constructor Summary
Constructors Constructor Description CompressedFileManager(File file)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkDirectoryToExtractTo(File todir)
Will check that the directory to extract to is a directory if it exists or create it otherwise.abstract void
extract(ManagedImageSource file, File todir)
abstract void
extract(File todir)
protected void
extractEntry(InputStream in, File path)
ManagedImageSource
getImageSource(String path)
Returns a specified image source specified by the path in the zip fileabstract ImageInputStream
getStream(ManagedImageSource source)
-
Methods declared in class com.ibm.dtfj.utils.file.FileManager
createTempDir, fileExists, genJavacoreName, getImageSources, getJavaCoreNameFromPHD, getManager, getStream, isArchive
-
-
-
-
Constructor Detail
-
CompressedFileManager
public CompressedFileManager(File file)
-
-
Method Detail
-
extract
public abstract void extract(File todir) throws IOException
- Throws:
IOException
-
extract
public abstract void extract(ManagedImageSource file, File todir) throws IOException
- Throws:
IOException
-
getStream
public abstract ImageInputStream getStream(ManagedImageSource source) throws IOException
- Throws:
IOException
-
checkDirectoryToExtractTo
protected void checkDirectoryToExtractTo(File todir)
Will check that the directory to extract to is a directory if it exists or create it otherwise.- Parameters:
todir
- directory to extract to- Throws:
IllegalArgumentException
- if the specified File is not a directory
-
getImageSource
public ManagedImageSource getImageSource(String path) throws IOException
Returns a specified image source specified by the path in the zip file- Parameters:
path
- path within the zip- Returns:
- the created image
- Throws:
IOException
- for problems creating the image or FileNotFoundException if the file specified by the path could not be found
-
extractEntry
protected void extractEntry(InputStream in, File path) throws IOException
- Throws:
IOException
-
-