4 * This file is part of Zippy.
6 * (c) Alchemy <info@alchemy.fr>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Alchemy\Zippy\Archive;
14 use Alchemy\Zippy\Adapter\Resource\ResourceInterface;
15 use Alchemy\Zippy\Exception\InvalidArgumentException;
16 use Alchemy\Zippy\Exception\RuntimeException;
18 interface MemberInterface
21 * Gets the location of an archive member
25 public function getLocation();
28 * Tells whether the member is a directory or not
32 public function isDir();
35 * Returns the last modified date of the member
39 public function getLastModifiedDate();
42 * Returns the (uncompressed) size of the member
44 * If the size is unknown, returns -1
48 public function getSize();
51 * Extract the member from its archive
53 * Be careful using this method within a loop
54 * This will execute one extraction process for each file
55 * Prefer the use of ArchiveInterface::extractMembers in that use case
57 * @param string|null $to The path where to extract the member, if no path is not provided the member is extracted in the same directory of its archive
58 * @param bool $overwrite Whether to overwrite destination file if it already exists. Defaults to false
60 * @return \SplFileInfo The extracted file
62 * @throws RuntimeException In case of failure
63 * @throws InvalidArgumentException In case no members could be removed or provide extract target directory is not valid
65 public function extract($to = null, $overwrite = false);
70 * @return ResourceInterface
72 public function getResource();
77 public function __toString();