Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / search / Zend / Search / Lucene / Storage / Directory.php
blob67e2b295f528de5b860770936a37501f31430e9b
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
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.
15 * @category Zend
16 * @package Zend_Search_Lucene
17 * @subpackage Storage
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
23 /**
24 * @category Zend
25 * @package Zend_Search_Lucene
26 * @subpackage Storage
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
33 /**
34 * Closes the store.
36 * @return void
38 abstract public function close();
40 /**
41 * Returns an array of strings, one for each file in the directory.
43 * @return array
45 abstract public function fileList();
47 /**
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);
56 /**
57 * Removes an existing $filename in the directory.
59 * @param string $filename
60 * @return void
62 abstract public function deleteFile($filename);
65 /**
66 * Returns true if a file with the given $filename exists.
68 * @param string $filename
69 * @return boolean
71 abstract public function fileExists($filename);
74 /**
75 * Returns the length of a $filename in the directory.
77 * @param string $filename
78 * @return integer
80 abstract public function fileLength($filename);
83 /**
84 * Returns the UNIX timestamp $filename was last modified.
86 * @param string $filename
87 * @return integer
89 abstract public function fileModified($filename);
92 /**
93 * Renames an existing file in the directory.
95 * @param string $from
96 * @param string $to
97 * @return void
99 abstract public function renameFile($from, $to);
103 * Sets the modified time of $filename to now.
105 * @param string $filename
106 * @return void
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);