Class PackFile
java.lang.Object
java.io.File
org.eclipse.jgit.internal.storage.file.PackFile
- All Implemented Interfaces:
Serializable
,Comparable<File>
A pack file (or pack related) File.
Example: "pack-0123456789012345678901234567890123456789.idx"
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final boolean
private final String
private final PackExt
private static final String
private static final long
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a PackFile for a pack or related file.Create a PackFile for a pack or related file.Create a PackFile for a pack or related file.Create a PackFile for a pack or related file. -
Method Summary
Modifier and TypeMethodDescriptionCreate a new similar PackFile with the given extension instead.createForDirectory
(File directory) Create a new similar PackFile in the given directory.private static String
createName
(String id, PackExt extension) createPreservedForDirectory
(File directory) Create a new similar preserved PackFile in the given directory.private String
private static String
getExtPrefix
(boolean isPreserved) getId()
Getter for the fieldid
.private String
getName
(boolean isPreserved) private String
Getter for the fieldpackExt
.private static PackExt
getPackExt
(String endsWithExtension) 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
PREFIX
- See Also:
-
base
-
id
-
hasOldPrefix
private final boolean hasOldPrefix -
packExt
-
-
Constructor Details
-
PackFile
Create a PackFile for a pack or related file.- Parameters:
file
- File pointing to the location of the file.
-
PackFile
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
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.
-
PackFile
Create a PackFile for a pack or related file.- Parameters:
directory
- Directory to create the PackFile in.name
- Filename (last path section) of the PackFile
-
-
Method Details
-
createName
-
getId
Getter for the fieldid
.- Returns:
- the
id
(40 Hex char) section of the name.
-
getPackExt
Getter for the fieldpackExt
.- Returns:
- the
packExt
of the name.
-
create
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
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
-
createPreservedForDirectory
Create a new similar preserved PackFile in the given directory.- Parameters:
directory
- Directory to create the new PackFile in.- Returns:
- a PackFile in the given directory with "old-" prefixing the extension
-
getName
-
getName
-
getExtension
-
getExtPrefix
-
getPackExt
-