org.xcmis.search.lucene.index
Interface ConcurrentDirectoryFactory

All Known Implementing Classes:
ReadWriteDirectoryFactory, ReentrantDirectoryFactory

public interface ConcurrentDirectoryFactory

Created by The eXo Platform SAS.
Date:

Version:
$Id: ConcurrentDirectoryFactory.java 2 2010-02-04 17:21:49Z andrew00x $
Author:
Karpenko Sergiy

Method Summary
 File createFile(File dir, String filename, int dirCount)
          Create file with locking of dirCount parent directories.
 void removeDirectory(File dir, int dirCount)
          Try remove directory and parent directories.
 

Method Detail

createFile

File createFile(File dir,
                String filename,
                int dirCount)
                throws IOException,
                       TransactionLogException
Create file with locking of dirCount parent directories.

Parameters:
dir - - parent directory of file
filename - - name of file
dirCount - - count of parent directories that will be locked during create file execution
Returns:
File - created file
Throws:
IOException - - I/O Exception
TransactionLogException - - if file already exist, or file or it's parent directory was not created (or not exist)

removeDirectory

void removeDirectory(File dir,
                     int dirCount)
                     throws TransactionLogException
Try remove directory and parent directories. Maximum count of removed directories is dirCount.

Parameters:
dir - - directory to remove.
dirCount - - maximum count of removed directories. dir counted to.
Throws:
TransactionLogException - - if directory do not contain subfiles, but was not removed.


Copyright © 2010 eXo Platform SAS. All Rights Reserved.