openlsd.server.admin.LSDCheckSimilar Class Reference

Inheritance diagram for openlsd.server.admin.LSDCheckSimilar:

Inheritance graph
[legend]
Collaboration diagram for openlsd.server.admin.LSDCheckSimilar:

Collaboration graph
[legend]

List of all members.


Detailed Description

This class is about to check if a specific file is already inserted in one specific Legacy of OpenLSD. It checks first the existence of one file with same length and MD5, then, if there is at least one, it checks if the files are really the same.
WARNING: This function is only compatible with not crypted Legacy!

WARNING: This function needs (for efficiency) to add the index IDX_DOC_LIDSIZEDOCMD5 in the database.
This version can only be used on the OpenLSD Server due to the necessity to get direct access on files stored in OpenLSD Legacy.

Author:
Frederic BREGIER LGPL 2008

Public Member Functions

 LSDCheckSimilar (LSDLoadConfig llc)
 LSDCheckSimilar (LSDDbAdmin admin, LSDLegacy legacy)
void clean ()
LSDExtDbDocument getIfExists (String filepath)
LSDExtDbDocument getIfExists (File file)

Static Public Member Functions

static void main (String[] args)

Static Public Attributes

static LSDLoadConfig llc = null

Protected Attributes

LSDDbAdmin admin = null
LSDLegacy lsdlegacy = null

Constructor & Destructor Documentation

openlsd.server.admin.LSDCheckSimilar.LSDCheckSimilar ( LSDLoadConfig  llc  ) 

Create the CheckSimilar object from Main procedure

Parameters:
llc 

openlsd.server.admin.LSDCheckSimilar.LSDCheckSimilar ( LSDDbAdmin  admin,
LSDLegacy  legacy 
)

Create the CheckSimilar object from other main

Parameters:
admin 
legacy 


Member Function Documentation

static void openlsd.server.admin.LSDCheckSimilar.main ( String[]  args  )  [static]

Check if a specific file is already inserted in one specific Legacy of OpenLSD.
Returns 0 if this file does not exist already in the Legacy, else if it exists it returns 1 and prints to stdout the LSD index of the existing document.

Parameters:
args with the config filename (db config) as first arg, then the LSD config filename as second arg, then the Legacy id as third arg, then the path to the file to check as fourth arg.

void openlsd.server.admin.LSDCheckSimilar.clean (  ) 

LSDExtDbDocument openlsd.server.admin.commoncheck.LSDCheckSimilarAbstract.getIfExists ( String  filepath  )  [inherited]

Returns the Document if it exists, else null

Parameters:
filepath 
Returns:
the Document if it exists, else null

LSDExtDbDocument openlsd.server.admin.commoncheck.LSDCheckSimilarAbstract.getIfExists ( File  file  )  [inherited]

Returns the Document if it exists, else null

Parameters:
file to check if it exists
Returns:
the Document if it exists, else null


Member Data Documentation

Object to load XML configuration

The DBAdmin connector

The LSD Legacy object


The documentation for this class was generated from the following file: