|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.at4j.archive.AbstractArchiveEntry<TarEntry,TarDirectoryEntry> org.at4j.tar.TarEntry org.at4j.tar.TarFileEntry
public class TarFileEntry
This object represents a Unix v7 Tar file entry. All Tar file entries support being opened for random access.
Tar entry objects are always immutable.
TarDirectoryEntry
,
TarSymbolicLinkEntry
Method Summary | |
---|---|
long |
getDataSize()
Get the size of the file data for this Tar file entry. |
protected UnixEntityMode |
getDefaultEntityMode()
Subclasses implement this to return the default Unix entity mode if none is set in the Tar file. |
long |
getSize()
Get the size of the file data for this Tar file entry. |
long |
getStartPosOfFileData()
Get the start position of file data in the Tar file for this Tar file entry. |
EntityLock |
getWriteLock()
This method returns a dummy lock. |
boolean |
isWriteLockedByCurrentThread()
This method always returns true . |
EntityLock |
lockForWriting()
This method returns a dummy lock. |
ScatteringByteChannel |
openChannelForRead()
Open a ScatteringByteChannel that a client can use to read file
data from the Tar file entry. |
RandomAccess |
openForRandomAccess(RandomAccessMode ram)
Open the file for random access in the specified mode. |
InputStream |
openForRead()
Open an InputStream that a client can use to read file data from
the Tar file entry. |
Methods inherited from class org.at4j.tar.TarEntry |
---|
getChecksum, getEntityMode, getLastModificationTime, getOwnerGid, getOwnerUid |
Methods inherited from class org.at4j.archive.AbstractArchiveEntry |
---|
getCollaborator, getLocation, getName, getParent, getReadLock, isReadLockedByCurrentThread, lockForReading |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.at4j.archive.ArchiveEntry |
---|
getLocation, getParent |
Methods inherited from interface org.entityfs.Named |
---|
getName |
Methods inherited from interface org.entityfs.lock.ReadLockable |
---|
getReadLock, isReadLockedByCurrentThread, lockForReading |
Method Detail |
---|
protected UnixEntityMode getDefaultEntityMode()
TarEntry
getDefaultEntityMode
in class TarEntry
public EntityLock lockForWriting() throws LockTimeoutException
lockForWriting
in interface WriteLockable
LockTimeoutException
- If the lock acquiring timed out. (It is up
to the LockAcquiringStrategy
to decide if lock acquiring can time
out.)public EntityLock getWriteLock()
getWriteLock
in interface WriteLockable
public boolean isWriteLockedByCurrentThread()
true
.
isWriteLockedByCurrentThread
in interface WriteLockable
true
, always.public ScatteringByteChannel openChannelForRead()
ScatteringByteChannel
that a client can use to read file
data from the Tar file entry.
openChannelForRead
in interface ReadableFile
ReadableFile.openForRead()
public InputStream openForRead()
InputStream
that a client can use to read file data from
the Tar file entry.
openForRead
in interface ReadableFile
public RandomAccess openForRandomAccess(RandomAccessMode ram) throws ReadOnlyException
RandomlyAccessibleFile
Although a read or write lock on the file is required for the execution
thread opening the RandomAccess
, the RandomAccess
object
itself is not protected from access by other threads. It can be protected
by wrapping it in a LockAwareRandomAccess
object.
openForRandomAccess
in interface RandomlyAccessibleFile
ram
- The mode to open the file in.
RandomAccess
object. It must be closed by the
caller.
ReadOnlyException
- If the client tries to open a read only file
for writing.public long getStartPosOfFileData()
Clients seldom have to bother with this.
public long getDataSize()
0
and 8589934591
bytes (~ 8.6 Gb) (inclusive).
This method returns the same value as getSize()
.
getDataSize
in interface ReadableFile
ReadableFile.getSize()
public long getSize()
0
and 8589934591
bytes (~ 8.6 Gb) (inclusive).
This method returns the same value as getDataSize()
.
getSize
in interface ReadableFile
ReadableFile.getDataSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |