Style Intelligence v12.0

inetsoft.sree.store
Interface DataStorage

All Known Subinterfaces:
VersionedStorage

public interface DataStorage

This interface defines the API of a data storage system. It is modeled after the CVS command set, but can be easily implemented using other version control system or plain file system.


Method Summary
 OutputStream add(String path)
          Add an archive file to the data storage.
 Object checkout(String path)
          Checkout an archive file from the storage.
 String commit(String path)
          Commit the add change made so far.
 void init(String root)
          Init the data storage.
 String[] list(String path, boolean folder)
          List the archive files or folders in an archive folder.
 String[] log(String path)
          List versions of an archive file.
 boolean remove(String path)
          Remove an achive file from the storage.
 boolean rename(String opath, String npath)
          Rename an archive file.
 boolean update(String path)
          Update an archive folder.
 

Method Detail

init

void init(String root)
          throws Exception
Init the data storage.

Parameters:
root - the specified root path.
Throws:
Exception

add

OutputStream add(String path)
                 throws IOException
Add an archive file to the data storage. This change needs to be committed.

Parameters:
path - the specified archive file path.
Returns:
output stream to write data into.
Throws:
IOException

checkout

Object checkout(String path)
                throws IOException
Checkout an archive file from the storage.

Parameters:
path - the specified archive file path.
Returns:
object that encapsulates the data in the file. The object must be an instance of one of the following types - byte[], InputStream, or File.
Throws:
IOException

commit

String commit(String path)
              throws IOException
Commit the add change made so far.

Parameters:
path - the specified archive file path.
Returns:
the version of the archive file if the commit is successful, null otherwise.
Throws:
IOException

remove

boolean remove(String path)
               throws IOException
Remove an achive file from the storage.

Parameters:
path - the specified archive file path.
Returns:
true if success, false otherwise.
Throws:
IOException

list

String[] list(String path,
              boolean folder)
              throws IOException
List the archive files or folders in an archive folder.

Parameters:
path - the specified arhive folder path.
folder - true to list archive folders, false to list archive files.
Returns:
the archive files or folders in the archive folder.
Throws:
IOException

update

boolean update(String path)
               throws IOException
Update an archive folder.

Parameters:
path - the specified archive folder path.
Returns:
true if successful, false otherwise.
Throws:
IOException

rename

boolean rename(String opath,
               String npath)
               throws IOException
Rename an archive file.

Parameters:
opath - the specified old archive file path.
npath - the specified new archive file path.
Returns:
true if successful, false otherwise.
Throws:
IOException

log

String[] log(String path)
             throws IOException
List versions of an archive file.

Parameters:
path - the specified archive file path.
Returns:
versions of the archive file.
Throws:
IOException

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.