Class PackFile
- java.lang.Object
-
- java.io.File
-
- org.eclipse.jgit.internal.storage.file.PackFile
-
- All Implemented Interfaces:
Serializable
,Comparable<File>
public class PackFile extends File
A pack file (or pack related) File. Example: "pack-0123456789012345678901234567890123456789.idx"- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
-
-
Constructor Summary
Constructors Constructor Description PackFile(File file)
Create a PackFile for a pack or related file.PackFile(File directory, String name)
Create a PackFile for a pack or related file.PackFile(File directory, String id, PackExt ext)
Create a PackFile for a pack or related file.PackFile(File directory, ObjectId id, PackExt ext)
Create a PackFile for a pack or related file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PackFile
create(PackExt ext)
Create a new similar PackFile with the given extension instead.PackFile
createForDirectory(File directory)
Create a new similar PackFile in the given directory.PackFile
createPreservedForDirectory(File directory)
Create a new similar preserved PackFile in the given directory.String
getId()
Getter for the fieldid
.PackExt
getPackExt()
Getter for the fieldpackExt
.-
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
-
-
-
Constructor Detail
-
PackFile
public PackFile(File file)
Create a PackFile for a pack or related file.- Parameters:
file
- File pointing to the location of the file.
-
PackFile
public PackFile(File directory, ObjectId id, PackExt ext)
Create a PackFile for a pack or related file.- Parameters:
directory
- Directory to create the PackFile in.id
- theObjectId
for this packext
- thepackExt
of the name.
-
PackFile
public PackFile(File directory, String id, PackExt ext)
Create a PackFile for a pack or related file.- Parameters:
directory
- Directory to create the PackFile in.id
- theid
(40 Hex char) section of the pack name.ext
- thepackExt
of the name.
-
-
Method Detail
-
getId
public String getId()
Getter for the fieldid
.- Returns:
- the
id
(40 Hex char) section of the name.
-
getPackExt
public PackExt getPackExt()
Getter for the fieldpackExt
.- Returns:
- the
packExt
of the name.
-
create
public PackFile create(PackExt ext)
Create a new similar PackFile with the given extension instead.- Parameters:
ext
- PackExt the extension to use.- Returns:
- a PackFile instance with specified extension
-
createForDirectory
public PackFile createForDirectory(File directory)
Create a new similar PackFile in the given directory.- Parameters:
directory
- Directory to create the new PackFile in.- Returns:
- a PackFile in the given directory
-
-