org.molgenis.omx.services
Class StorageHandler

java.lang.Object
  extended by org.molgenis.omx.services.StorageHandler
Direct Known Subclasses:
MolgenisFileHandler

public class StorageHandler
extends Object


Constructor Summary
StorageHandler(Database db)
          On instantiation, build a simple report of the current state, without running actual validation yet.
 
Method Summary
 void deleteFileStorage(Database db)
          Remove file storage location and validation status.
 File getFileStorage(boolean mustBeValid, Database db)
          Get the path of the file storage.
 File getFileStorage(Database db)
          Get the path of the file storage, regardless whether it is valid or not.
 Report getReport()
           
 boolean hasFileStorage(boolean mustBeValid, Database db)
          Ask if these is a file storage location available, regardless whether it is valid or not.
 boolean hasValidFileStorage(Database db)
          Ask if these is a valid file storage location available.
 void setFileStorage(String filesource, Database db)
          Save this path in the form of a string to the file storage path entity.
 void validateFileStorage(Database db)
          Run validation check on the current set file storage path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageHandler

public StorageHandler(Database db)
On instantiation, build a simple report of the current state, without running actual validation yet.

Parameters:
db -
Method Detail

getFileStorage

public File getFileStorage(Database db)
                    throws Exception
Get the path of the file storage, regardless whether it is valid or not. Throws exception if there is no storage location set.

Throws:
Exception

getFileStorage

public File getFileStorage(boolean mustBeValid,
                           Database db)
                    throws Exception
Get the path of the file storage. Uses the application name to make it (more?) unique. Throws exception if there is no storage location set.

Parameters:
mustBeValid -
Returns:
Throws:
Exception

deleteFileStorage

public void deleteFileStorage(Database db)
                       throws Exception
Remove file storage location and validation status.

Throws:
Exception

hasFileStorage

public boolean hasFileStorage(boolean mustBeValid,
                              Database db)
                       throws Exception
Ask if these is a file storage location available, regardless whether it is valid or not.

Parameters:
mustBeValid -
Returns:
Throws:
Exception

hasValidFileStorage

public boolean hasValidFileStorage(Database db)
                            throws Exception
Ask if these is a valid file storage location available.

Returns:
Throws:
Exception

setFileStorage

public void setFileStorage(String filesource,
                           Database db)
                    throws Exception
Save this path in the form of a string to the file storage path entity.

Parameters:
filesource -
Throws:
Exception

validateFileStorage

public void validateFileStorage(Database db)
                         throws Exception
Run validation check on the current set file storage path.

Throws:
Exception

getReport

public Report getReport()


Copyright © 2013. All Rights Reserved.