Public Member Functions | |
LSDDocument (LSDStorage storage, long did) | |
String | getFileGlobalPath () |
String | getFileAbstractName () |
String | getFileBasePath () |
void | clear () |
boolean | isFile () |
long | getFileLength () |
void | setLoopIdUnique (LSDStorage storage, long did) |
boolean | isInWritingProcess () |
boolean | write (byte[] bytes) |
boolean | writeBlock (byte[] bytes) |
boolean | writeBlockEnd (byte[] bytes) |
long | write (FileChannel fileChannelIn) |
long | write (InputStream inputStream) |
boolean | writeCrypto (byte[] bytes) |
boolean | writeBlockCrypto (byte[] bytes) |
boolean | writeBlockCryptoEnd (byte[] bytes) |
long | writeCrypto (FileChannel fileChannelIn) |
long | writeCrypto (InputStream inputStream) |
byte[] | get () |
byte[] | getBlock (int sizeblock) |
boolean | get (FileChannel fileChannelOut) |
byte[] | getCrypto () |
byte[] | getBlockCrypto (int sizeblock) |
boolean | getCrypto (FileChannel fileChannelOut) |
boolean | delete () |
LSDDocument | move (long sidSto, long didFile) |
boolean | move (LSDDocument docnew) |
String | computeMD5 () |
boolean | isInternalMD5Equal (String shash) |
boolean | isMD5equal (String shash) |
boolean | setLSDPath (long id) |
String | getGlobalPath () |
String | getAbstractName () |
String | getGlobalPathWoBasename () |
String | getBaseName () |
Public Attributes | |
long | idUnique = LSDConstants.invalide_idx |
Private Member Functions | |
CipherInputStream | getCipherInputStream () |
CipherOutputStream | getCipherOutputStream () |
FileChannel | getFileChannel (boolean isOut) |
boolean | updateLastTime () |
Private Attributes | |
boolean | isReady = false |
LSDStorage | storage = null |
File | realFile = null |
String | realPath = null |
FileChannel | bfileChannelOut = null |
FileChannel | bfileChannelIn = null |
CipherOutputStream | bcipherOut = null |
CipherInputStream | bcipherIn = null |
ByteBuffer | bbyteBuffer = null |
openlsd.network.server.legacy.LSDDocument.LSDDocument | ( | LSDStorage | storage, | |
long | did | |||
) |
Create a new LSDDocument according to the storage and its did (unique id for the document).
The LSDDocument is marked as Ready.
storage | associated Storage | |
did | Document Id |
String openlsd.network.server.legacy.LSDDocument.getFileGlobalPath | ( | ) |
To get FileGlobalPath (/basePath/a/b/c)
String openlsd.network.server.legacy.LSDDocument.getFileAbstractName | ( | ) |
To get FileAbstractName (/outPath/_a_b_c)
String openlsd.network.server.legacy.LSDDocument.getFileBasePath | ( | ) |
To get FileBasePath (/basePath/a/b without c)
void openlsd.network.server.legacy.LSDDocument.clear | ( | ) |
Set empty this LSDDocument, mark it unReady
Reimplemented from openlsd.network.server.legacy.LSDPath.
boolean openlsd.network.server.legacy.LSDDocument.isFile | ( | ) |
Returns true if the file exists physically. If the document is unReady (isReady false), returns false.
long openlsd.network.server.legacy.LSDDocument.getFileLength | ( | ) |
Returns the file length. Warning: this length can be different than the real document size, since the crypto algorithm increase a little the file size compared to the original file size.
void openlsd.network.server.legacy.LSDDocument.setLoopIdUnique | ( | LSDStorage | storage, | |
long | did | |||
) |
Set the did for the current Document: to use with really care.
The main goal is for quick loop index.
storage | associated Storage | |
did | Document Id |
boolean openlsd.network.server.legacy.LSDDocument.isInWritingProcess | ( | ) |
Returns the status of this Document if it is in current writing status (one block at least is written).
boolean openlsd.network.server.legacy.LSDDocument.write | ( | byte[] | bytes | ) |
Write in the associated Legacy/Storage the Document with the given byte array, limitating the file size to 2^32 bytes.
The mode is non crypted.
bytes | for the file |
boolean openlsd.network.server.legacy.LSDDocument.writeBlock | ( | byte[] | bytes | ) |
Write in the associated Legacy/Storage the Document with the given byte array. The file is not limited to 2^32 bytes since this write operation is in add mode.
The mode is non crypted.
bytes | added to the file |
boolean openlsd.network.server.legacy.LSDDocument.writeBlockEnd | ( | byte[] | bytes | ) |
End the Write in the associated Legacy/Storage the Document with the given byte array. The file is not limited to 2^32 bytes since this write operation is in add mode.
The mode is non crypted.
bytes | added to the file |
long openlsd.network.server.legacy.LSDDocument.write | ( | FileChannel | fileChannelIn | ) |
Write in the associated Legacy/Storage the Document with the given fileChannelIn. The file is not limited to 2^32 bytes since it depends on the FileChannel itself.
The mode is non crypted.
This call closes the fileChannelIn with fileChannelIn.close() if the operation is in success.
fileChannelIn | source of the file |
long openlsd.network.server.legacy.LSDDocument.write | ( | InputStream | inputStream | ) |
Write in the associated Legacy/Storage the Document with the given inputStream. The file is not limited to 2^32 bytes since it depends on the inputStream itself.
The mode is non crypted.
This call closes the inputStream with inputStream.close() if the operation is in success.
inputStream | for the file |
boolean openlsd.network.server.legacy.LSDDocument.writeCrypto | ( | byte[] | bytes | ) |
Write in the associated Legacy/Storage the Document with the given byte array, limitating the file size to 2^32 bytes.
The mode is crypted.
bytes | for the file |
boolean openlsd.network.server.legacy.LSDDocument.writeBlockCrypto | ( | byte[] | bytes | ) |
Write in the associated Legacy/Storage the Document with the given byte array. The file is not limited to 2^32 bytes since this write operation is in add mode.
The mode is crypted.
bytes | added to the file |
boolean openlsd.network.server.legacy.LSDDocument.writeBlockCryptoEnd | ( | byte[] | bytes | ) |
End the Write in the associated Legacy/Storage the Document with the given byte array. The file is not limited to 2^32 bytes since this write operation is in add mode.
The mode is crypted.
bytes | added to the file |
long openlsd.network.server.legacy.LSDDocument.writeCrypto | ( | FileChannel | fileChannelIn | ) |
Write in the associated Legacy/Storage the Document with the given fileChannelIn. The file is not limited to 2^32 bytes since it depends on the FileChannel itself.
The mode is crypted.
This call closes the fileChannelIn with fileChannelIn.close() if the operation is in success.
fileChannelIn | source of the file |
long openlsd.network.server.legacy.LSDDocument.writeCrypto | ( | InputStream | inputStream | ) |
Write in the associated Legacy/Storage the Document with the given inputStream. The file is not limited to 2^32 bytes since it depends on the inputStream itself.
The mode is crypted.
This call closes the inputStream with inputStream.close() if the operation is in success.
inputStream | source of the file |
byte [] openlsd.network.server.legacy.LSDDocument.get | ( | ) |
Get the byte array of the Document stored in the associated Legacy/Storage, limitating the file size to 2^32 bytes.
The mode is non crypted.
byte [] openlsd.network.server.legacy.LSDDocument.getBlock | ( | int | sizeblock | ) |
Get the current block byte array of the Document stored in the associated Legacy/Storage. There is therefore no limitation of the file size to 2^32 bytes.
The returned block is limited to sizeblock. If the returned block is less than sizeblock length, it is the last block to read.
The mode is non crypted.
sizeblock | is the limit size for the block array |
boolean openlsd.network.server.legacy.LSDDocument.get | ( | FileChannel | fileChannelOut | ) |
Write the Document stored in the associated Legacy/Storage to the fileChannelOut, thus bypassing the limitation of the file size to 2^32 bytes.
The mode is non crypted.
This call closes the fileChannelOut with fileChannelOut.close() if the operation is in success.
fileChannelOut |
byte [] openlsd.network.server.legacy.LSDDocument.getCrypto | ( | ) |
Get the byte array of the Document stored in the associated Legacy/Storage, limitating the file size to 2^32 bytes.
The mode is crypted.
byte [] openlsd.network.server.legacy.LSDDocument.getBlockCrypto | ( | int | sizeblock | ) |
Get the current block byte array of the Document stored in the associated Legacy/Storage. There is therefore no limitation of the file size to 2^32 bytes.
The returned block is limited to sizeblock. If the returned block is less than sizeblock length, it is the last block to read.
The mode is crypted.
sizeblock | is the limit size for the block array |
boolean openlsd.network.server.legacy.LSDDocument.getCrypto | ( | FileChannel | fileChannelOut | ) |
Write the Document stored in the associated Legacy/Storage to the fileChannelOut, thus bypassing the limitation of the file size to 2^32 bytes.
The mode is crypted.
This call closes the fileChannelOut with fileChannelOut.close() if the operation is in success.
fileChannelOut |
boolean openlsd.network.server.legacy.LSDDocument.delete | ( | ) |
Delete physically the file associated with this Legacy / Storage / Document.
The LSDDocument is not cleared itself.
LSDDocument openlsd.network.server.legacy.LSDDocument.move | ( | long | sidSto, | |
long | didFile | |||
) |
Move physically the file from one triple LSD to another triple where only the Storage and Document can change.
This version is optimized for moving in the same Legacy.
It returns the new LSDDocument associated or null if error.
Runs both in crypted and non crypted mode.
sidSto | Storage Id as destination | |
didFile | Document Id as destination |
boolean openlsd.network.server.legacy.LSDDocument.move | ( | LSDDocument | docnew | ) |
Move physically the file from one triple LSD to another triple LSD, whatever the changes.
It returns True if the move is ok, False if move failed.
Runs both in crypted and non crypted mode, whatever the source and destination.
docnew | New LSDDocument destination |
CipherInputStream openlsd.network.server.legacy.LSDDocument.getCipherInputStream | ( | ) | [private] |
Returns a CiptherInputStream for access to the file in Read mode.
Crypted Mode
CipherOutputStream openlsd.network.server.legacy.LSDDocument.getCipherOutputStream | ( | ) | [private] |
Returns a CiptherOutputStream for access to the file in Write mode.
Crypted Mode
FileChannel openlsd.network.server.legacy.LSDDocument.getFileChannel | ( | boolean | isOut | ) | [private] |
Returns the FileChannel in Out mode (if isOut is True) or in In mode (if isOut is False) associated with the file of the LSDDocument.
The mode is non crypted.
isOut |
boolean openlsd.network.server.legacy.LSDDocument.updateLastTime | ( | ) | [private] |
Set the LastTime on the Directories up to the root of the current Legacy
String openlsd.network.server.legacy.LSDDocument.computeMD5 | ( | ) |
Compute the MD5 for the Document (Hex version)
boolean openlsd.network.server.legacy.LSDDocument.isInternalMD5Equal | ( | String | shash | ) |
Test if MD5 as parameter is the same as the one from the file (internaly not physical, so not correct when considering crypted file but only considering decrypted file).
shash |
boolean openlsd.network.server.legacy.LSDDocument.isMD5equal | ( | String | shash | ) |
Test if MD5 as parameter is the same as the one from the file
shash |
boolean openlsd.network.server.legacy.LSDPath.setLSDPath | ( | long | id | ) | [inherited] |
String openlsd.network.server.legacy.LSDPath.getGlobalPath | ( | ) | [inherited] |
Get LGlobalPath (/a/b/c)
String openlsd.network.server.legacy.LSDPath.getAbstractName | ( | ) | [inherited] |
Get LAbstractName (_a_b_c)
String openlsd.network.server.legacy.LSDPath.getGlobalPathWoBasename | ( | ) | [inherited] |
Get GlobalPath without Basename (/a/b)
String openlsd.network.server.legacy.LSDPath.getBaseName | ( | ) | [inherited] |
Get BaseName (c)
boolean openlsd.network.server.legacy.LSDDocument.isReady = false [private] |
Is this Document ready to be accessed
LSDStorage openlsd.network.server.legacy.LSDDocument.storage = null [private] |
associated Storage
File openlsd.network.server.legacy.LSDDocument.realFile = null [private] |
The associated FILE
String openlsd.network.server.legacy.LSDDocument.realPath = null [private] |
Full path
FileChannel openlsd.network.server.legacy.LSDDocument.bfileChannelOut = null [private] |
FileChannel Out
FileChannel openlsd.network.server.legacy.LSDDocument.bfileChannelIn = null [private] |
FileChannel In
CipherOutputStream openlsd.network.server.legacy.LSDDocument.bcipherOut = null [private] |
Cipher Out Stream
CipherInputStream openlsd.network.server.legacy.LSDDocument.bcipherIn = null [private] |
Cipher In Stream
ByteBuffer openlsd.network.server.legacy.LSDDocument.bbyteBuffer = null [private] |
Associated ByteBuffer
long openlsd.network.server.legacy.LSDPath.idUnique = LSDConstants.invalide_idx [inherited] |
Id between LSDConstants.minimal_idx and maximal_idx