public class

JDB2Manager

extends Object
implements IFileDatabase
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.dao.impl.JDB2Manager

Class Overview

JEB database file ("*.jdb2") manager.

Summary

Constants
String EXTENSION JEB database file extension with the Leading dot.
int FLAG_COMPRESS This flags is used to specify that the record should be compressed
int FLAG_CRCCHECK The record should be accompanied by a CRC32 value to verify its basic integrity
int FLAG_ENCRYPT This flags is used to specify that the record should be encrypted
int FLAG_NONE No flag
int MARKER File header marker, little-endian: JDB2
int TYPE_ARTIFACTS Artifacts collections, little-endian: ART
int TYPE_PROJECT Project block marker, little-endian: PRJ
int TYPE_PROJECT_CONFIGURATION Persisted Project Configuration: PPC
int TYPE_PROJECT_METADATA Persisted Project Metadata: PPM
int TYPE_QSTATES Quick-states block marker, little-endian: QCK
Public Constructors
JDB2Manager(String basedir)
Public Methods
boolean deleteFile(String key)
Delete a file.
IFileDatabaseReader getDatabaseReader(String key)
Get a database record reader.
IFileDatabaseWriter getDatabaseWriter(String key)
Get a database record writer.
File getFileObject(String key)
Attempt to get the filesystem object backing this db file entry.
InputStream getFileReader(String key)
Get an input stream reader for low-level reading from a file.
OutputStream getFileWriter(String key)
Get an output stream reader for low-level writing to a file.
boolean hasFile(String key)
Determine if the database contains the given file (the file must exist).
byte[] loadFile(String key)
DO NOT USE! PROJECT record only, old format!
static String projectTypeToName(int type)
boolean saveFile(String key, byte[] data)
DO NOT USE! PROJECT record only, old format!
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.dao.IFileDatabase

Constants

public static final String EXTENSION

JEB database file extension with the Leading dot. The case matters.

Constant Value: ".jdb2"

public static final int FLAG_COMPRESS

This flags is used to specify that the record should be compressed

Constant Value: 1 (0x00000001)

public static final int FLAG_CRCCHECK

The record should be accompanied by a CRC32 value to verify its basic integrity

Constant Value: 4 (0x00000004)

public static final int FLAG_ENCRYPT

This flags is used to specify that the record should be encrypted

Constant Value: 2 (0x00000002)

public static final int FLAG_NONE

No flag

Constant Value: 0 (0x00000000)

public static final int MARKER

File header marker, little-endian: JDB2

Constant Value: 843203658 (0x3242444a)

public static final int TYPE_ARTIFACTS

Artifacts collections, little-endian: ART

Constant Value: 5526081 (0x00545241)

public static final int TYPE_PROJECT

Project block marker, little-endian: PRJ

Constant Value: 4870736 (0x004a5250)

public static final int TYPE_PROJECT_CONFIGURATION

Persisted Project Configuration: PPC

Constant Value: 4411472 (0x00435050)

public static final int TYPE_PROJECT_METADATA

Persisted Project Metadata: PPM

Constant Value: 5066832 (0x004d5050)

public static final int TYPE_QSTATES

Quick-states block marker, little-endian: QCK

Constant Value: 4932433 (0x004b4351)

Public Constructors

public JDB2Manager (String basedir)

Public Methods

public boolean deleteFile (String key)

Delete a file.

Parameters
key file key
Returns
  • success indicator

public IFileDatabaseReader getDatabaseReader (String key)

Get a database record reader.

This method may not be implemented, in which case the implementation may throw an UnsupportedOperationException.@return

Throws
IOException

public IFileDatabaseWriter getDatabaseWriter (String key)

Get a database record writer.

This method may not be implemented, in which case the implementation may throw an UnsupportedOperationException.@return

Throws
IOException

public File getFileObject (String key)

Attempt to get the filesystem object backing this db file entry.

This method may not be implemented (e.g. if this database is not backed by on-disk files), in which case the implementation may throw an UnsupportedOperationException.

public InputStream getFileReader (String key)

Get an input stream reader for low-level reading from a file. The client is responsible for closing the stream after usage.

This method may not be implemented, in which case the implementation may throw an UnsupportedOperationException.@return

Throws
FileNotFoundException

public OutputStream getFileWriter (String key)

Get an output stream reader for low-level writing to a file. The client is responsible for closing the stream after usage.

This method may not be implemented, in which case the implementation may throw an UnsupportedOperationException.@return

Throws
FileNotFoundException

public boolean hasFile (String key)

Determine if the database contains the given file (the file must exist).

Parameters
key file key
Returns
  • presence indicator

public byte[] loadFile (String key)

DO NOT USE! PROJECT record only, old format!

Parameters
key file key
Returns
  • file data, null on error

public static String projectTypeToName (int type)

public boolean saveFile (String key, byte[] data)

DO NOT USE! PROJECT record only, old format!

Parameters
key file key
data file data
Returns
  • success indicator