Package org.eclipse.jgit.util
Class FS.Attributes
- java.lang.Object
-
- org.eclipse.jgit.util.FS.Attributes
-
- Enclosing class:
- FS
public static class FS.Attributes extends java.lang.Object
File attributes we typically care for.- Since:
- 3.3
-
-
Field Summary
Fields Modifier and Type Field Description private long
creationTime
private boolean
exists
private java.io.File
file
(package private) FS
fs
private boolean
isDirectory
private boolean
isExecutable
private boolean
isRegularFile
private boolean
isSymbolicLink
private java.time.Instant
lastModifiedInstant
protected long
length
file length
-
Constructor Summary
Constructors Constructor Description Attributes(java.io.File path, FS fs)
Constructor when there are issues with reading.Attributes(FS fs, java.io.File file, boolean exists, boolean isDirectory, boolean isExecutable, boolean isSymbolicLink, boolean isRegularFile, long creationTime, java.time.Instant lastModifiedInstant, long length)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) boolean
exists()
long
getCreationTime()
java.io.File
getFile()
java.time.Instant
getLastModifiedInstant()
long
getLastModifiedTime()
Deprecated.use getLastModifiedInstant insteadlong
getLength()
java.lang.String
getName()
boolean
isDirectory()
boolean
isExecutable()
boolean
isRegularFile()
boolean
isSymbolicLink()
-
-
-
Field Detail
-
isDirectory
private final boolean isDirectory
-
isSymbolicLink
private final boolean isSymbolicLink
-
isRegularFile
private final boolean isRegularFile
-
creationTime
private final long creationTime
-
lastModifiedInstant
private final java.time.Instant lastModifiedInstant
-
isExecutable
private final boolean isExecutable
-
file
private final java.io.File file
-
exists
private final boolean exists
-
length
protected long length
file length
-
fs
final FS fs
-
-
Constructor Detail
-
Attributes
Attributes(FS fs, java.io.File file, boolean exists, boolean isDirectory, boolean isExecutable, boolean isSymbolicLink, boolean isRegularFile, long creationTime, java.time.Instant lastModifiedInstant, long length)
-
Attributes
public Attributes(java.io.File path, FS fs)
Constructor when there are issues with reading. All attributes except given will be set to the default values.- Parameters:
fs
-path
-
-
-
Method Detail
-
isDirectory
public boolean isDirectory()
- Returns:
- true if this are the attributes of a directory
-
isExecutable
public boolean isExecutable()
- Returns:
- true if this are the attributes of an executable file
-
isSymbolicLink
public boolean isSymbolicLink()
- Returns:
- true if this are the attributes of a symbolic link
-
isRegularFile
public boolean isRegularFile()
- Returns:
- true if this are the attributes of a regular file
-
getCreationTime
public long getCreationTime()
- Returns:
- the time when the file was created
-
getLastModifiedTime
@Deprecated public long getLastModifiedTime()
Deprecated.use getLastModifiedInstant instead- Returns:
- the time (milliseconds since 1970-01-01) when this object was last modified
-
getLastModifiedInstant
public java.time.Instant getLastModifiedInstant()
- Returns:
- the time when this object was last modified
- Since:
- 5.1.9
-
getLength
public long getLength()
- Returns:
- length of this file object
-
getName
public java.lang.String getName()
- Returns:
- the filename
-
getFile
public java.io.File getFile()
- Returns:
- the file the attributes apply to
-
exists
boolean exists()
-
-