7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
16 * @package Zend_Search_Lucene
18 * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @package Zend_Search_Lucene
27 * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
28 * @license http://framework.zend.com/license/new-bsd New BSD License
30 abstract class Zend_Search_Lucene_Storage_Directory
38 abstract public function close();
41 * Returns an array of strings, one for each file in the directory.
45 abstract public function fileList();
48 * Creates a new, empty file in the directory with the given $filename.
50 * @param string $filename
51 * @return Zend_Search_Lucene_Storage_File
53 abstract public function createFile($filename);
57 * Removes an existing $filename in the directory.
59 * @param string $filename
62 abstract public function deleteFile($filename);
66 * Returns true if a file with the given $filename exists.
68 * @param string $filename
71 abstract public function fileExists($filename);
75 * Returns the length of a $filename in the directory.
77 * @param string $filename
80 abstract public function fileLength($filename);
84 * Returns the UNIX timestamp $filename was last modified.
86 * @param string $filename
89 abstract public function fileModified($filename);
93 * Renames an existing file in the directory.
99 abstract public function renameFile($from, $to);
103 * Sets the modified time of $filename to now.
105 * @param string $filename
108 abstract public function touchFile($filename);
112 * Returns a Zend_Search_Lucene_Storage_File object for a given $filename in the directory.
114 * If $shareHandler option is true, then file handler can be shared between File Object
115 * requests. It speed-ups performance, but makes problems with file position.
116 * Shared handler are good for short atomic requests.
117 * Non-shared handlers are useful for stream file reading (especial for compound files).
119 * @param string $filename
120 * @param boolean $shareHandler
121 * @return Zend_Search_Lucene_Storage_File
123 abstract public function getFileObject($filename, $shareHandler = true);