]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/stacker/file/class_BaseFileStack.php
Renamed Registry -> GenericRegistry to make it clear that this registry does
[core.git] / framework / main / classes / stacker / file / class_BaseFileStack.php
index 443e46b305fff4a620ae3a1367f51c5aca986a35..fbad6cd4107e1d937f34629cd0ed4a655df5af0f 100644 (file)
@@ -1,12 +1,17 @@
 <?php
 // Own namespace
-namespace CoreFramework\Stack\File;
+namespace Org\Mxchange\CoreFramework\Stacker\Filesystem;
 
 // Import framework stuff
-use CoreFramework\Factory\ObjectFactory;
-use CoreFramework\Filesystem\File\BaseBinaryFile;
-use CoreFramework\Generic\UnsupportedOperationException;
-use CoreFramework\Iterator\Filesystem\SeekableWritableFileIterator;
+use Org\Mxchange\CoreFramework\Factory\Filesystem\Stack\FileStackIndexFactory;
+use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Filesystem\File\BaseBinaryFile;
+use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
+use Org\Mxchange\CoreFramework\Iterator\Filesystem\SeekableWritableFileIterator;
+use Org\Mxchange\CoreFramework\Stacker\BaseStacker;
+
+// Import SPL stuff
+use \SplFileInfo;
 
 /**
  * A general file-based stack class
@@ -30,7 +35,7 @@ use CoreFramework\Iterator\Filesystem\SeekableWritableFileIterator;
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class BaseFileStack extends BaseStacker {
+abstract class BaseFileStack extends BaseStacker {
        /**
         * Magic for this stack
         */
@@ -165,14 +170,14 @@ class BaseFileStack extends BaseStacker {
        /**
         * Initializes this file-based stack.
         *
-        * @param       $fileName       File name of this stack
+        * @param       $fileInfoInstance       An instance of a SplFileInfo class
         * @param       $type           Type of this stack (e.g. url_source for URL sources)
         * @return      void
         * @todo        Currently the stack file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole stack file.
         */
-       protected function initFileStack ($fileName, $type) {
+       protected function initFileStack (SplFileInfo $fileInfoInstance, $type) {
                // Get a stack file instance
-               $fileInstance = ObjectFactory::createObjectByConfiguredName('stack_file_class', array($fileName, $this));
+               $fileInstance = ObjectFactory::createObjectByConfiguredName('stack_file_class', array($fileInfoInstance, $this));
 
                // Get iterator instance
                $iteratorInstance = ObjectFactory::createObjectByConfiguredName('file_iterator_class', array($fileInstance));
@@ -215,7 +220,7 @@ class BaseFileStack extends BaseStacker {
                 * Get stack index instance. This can be used for faster
                 * "defragmentation" and startup.
                 */
-               $indexInstance = FileStackIndexFactory::createFileStackIndexInstance($fileName, $type);
+               $indexInstance = FileStackIndexFactory::createFileStackIndexInstance($fileInfoInstance, $type);
 
                // And set it here
                $this->setIndexInstance($indexInstance);
@@ -408,16 +413,6 @@ class BaseFileStack extends BaseStacker {
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
-       /**
-        * Getter for file name
-        *
-        * @return      $fileName       The current file name
-        * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
-        */
-       public function getFileName () {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
-       }
-
        /**
         * Getter for size of given stack (array count)
         *