Top Description Fields Constructors Methods
org.apache.derby.impl.io.vfmem

public Class DataStoreEntry

extends Object
Class Inheritance
Imports
java.io.FileNotFoundException

A data store entry representing either a file or a directory.

If the entry is a directory, it doesn't create a data object.

Field Summary

Modifier and TypeField and Description
private final boolean
isDir

Tells if this entry is a directory or a regular file.

private boolean
isReadOnly

Tells if this entry is read-only or not.

private final String
path

The path of this entry.

private volatile boolean
released

Tells if the entry has been released or not.

private final BlockedByteArray
src

The data of the entry.

Constructor Summary

AccessConstructor and Description
public
DataStoreEntry(String
the path of the entry
path
,
boolean
whether the entry is a directory or a regular file
isDir
)

Creates a new data store entry.

Method Summary

Modifier and TypeMethod and Description
private void
checkIfReleased()

Checks if this entry has been released.

pack-priv BlockedByteArrayInputStream

Returns:

An InputStream-object.
getInputStream
()

Returns an input stream to read from this entry.

pack-priv BlockedByteArrayOutputStream

Returns:

An OutputStream-object.
getOutputStream
(boolean
tells whether the entry should be appended or not
append
)

Returns an output stream to write into this entry.

public boolean

Returns:

true if directory, false otherwise.
isDirectory
()

Tells if this entry is a directory.

public boolean

Returns:

true is read-only, false if not.
isReadOnly
()

Tells if this entry is read-only.

public long

Returns:

The length in bytes.
length
()

Returns the length of this entry.

pack-priv void
release()

Relases this entry.

public void
setLength(long
the length in number of bytes
newLength
)

Sets the length of this entry.

public void
setReadOnly()

Makes this entry read-only.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isDirback to summary
private final boolean isDir

Tells if this entry is a directory or a regular file.

isReadOnlyback to summary
private boolean isReadOnly

Tells if this entry is read-only or not.

pathback to summary
private final String path

The path of this entry.

releasedback to summary
private volatile boolean released

Tells if the entry has been released or not.

srcback to summary
private final BlockedByteArray src

The data of the entry.

Constructor Detail

DataStoreEntryback to summary
public DataStoreEntry(String path, boolean isDir)

Creates a new data store entry.

Parameters
path:String

the path of the entry

isDir:boolean

whether the entry is a directory or a regular file

Method Detail

checkIfReleasedback to summary
private void checkIfReleased()

Checks if this entry has been released.

Exceptions
IllegalStateException:
if the entry has been released
getInputStreamback to summary
pack-priv BlockedByteArrayInputStream getInputStream() throws FileNotFoundException

Returns an input stream to read from this entry.

Returns:BlockedByteArrayInputStream

An InputStream-object.

Exceptions
FileNotFoundException:
if this entry is a directory
getOutputStreamback to summary
pack-priv BlockedByteArrayOutputStream getOutputStream(boolean append) throws FileNotFoundException

Returns an output stream to write into this entry.

Parameters
append:boolean

tells whether the entry should be appended or not

Returns:BlockedByteArrayOutputStream

An OutputStream-object.

Exceptions
FileNotFoundException:
if this entry is a directory, or is read-only
isDirectoryback to summary
public boolean isDirectory()

Tells if this entry is a directory.

Returns:boolean

true if directory, false otherwise.

isReadOnlyback to summary
public boolean isReadOnly()

Tells if this entry is read-only.

Returns:boolean

true is read-only, false if not.

lengthback to summary
public long length()

Returns the length of this entry.

Returns:long

The length in bytes.

releaseback to summary
pack-priv void release()

Relases this entry.

setLengthback to summary
public void setLength(long newLength)

Sets the length of this entry.

Parameters
newLength:long

the length in number of bytes

setReadOnlyback to summary
public void setReadOnly()

Makes this entry read-only.