- java.lang.Object
-
- com.ibm.dtfj.utils.file.FileManager
-
- Direct Known Subclasses:
SimpleFileManager
public abstract class FileManager extends Object
Class which manages the files on the local system.
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
logger
static long
MIN_CORE_SIZE
-
Constructor Summary
Constructors Constructor Description FileManager()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static File
createTempDir(File parent)
Creates a unique temporary directory under the specified parentstatic boolean
fileExists(File file)
A platform aware file existence checker that allows for MVS datasets on z/OSprotected String
genJavacoreName(String[] s, int inc, int componentToInc)
abstract List<ManagedImageSource>
getImageSources()
protected String[]
getJavaCoreNameFromPHD(String name)
Generate a list of possible javacore names from a given phd name.static FileManager
getManager(File file)
Factory method for getting the correct manager to deal with the supplied fileabstract ImageInputStream
getStream()
Gets a stream for the file which is being managed, this could be an archive file or a normal file.static boolean
isArchive(File file)
-
-
-
Field Detail
-
MIN_CORE_SIZE
public static final long MIN_CORE_SIZE
- See Also:
- Constant Field Values
-
logger
protected static final Logger logger
-
-
Method Detail
-
getImageSources
public abstract List<ManagedImageSource> getImageSources() throws IOException
- Throws:
IOException
-
getStream
public abstract ImageInputStream getStream() throws IOException
Gets a stream for the file which is being managed, this could be an archive file or a normal file. If this is a compressed file then the stream returned will be a 'raw' stream onto file itself.- Returns:
- Throws:
IOException
-
createTempDir
public static File createTempDir(File parent) throws IOException
Creates a unique temporary directory under the specified parent- Parameters:
parent
-- Returns:
- Throws:
IOException
-
fileExists
public static boolean fileExists(File file)
A platform aware file existence checker that allows for MVS datasets on z/OS- Parameters:
file
- the file to check- Returns:
- true if the file exists, or the check cannot be performed in which case the default response of true is returned
-
getManager
public static FileManager getManager(File file)
Factory method for getting the correct manager to deal with the supplied file- Parameters:
file
-- Returns:
-
isArchive
public static boolean isArchive(File file)
-
getJavaCoreNameFromPHD
protected String[] getJavaCoreNameFromPHD(String name)
Generate a list of possible javacore names from a given phd name.- Parameters:
name
- the heap dump- Returns:
- candidate javacore names
-
-