Code Duplication    Length = 11-13 lines in 3 locations

includes/filerepo/file/File.php 3 locations

@@ 1635-1646 (lines=12) @@
1632
	 * @param bool|string $suffix If not false, the name of an archived file
1633
	 * @return string
1634
	 */
1635
	function getArchiveUrl( $suffix = false ) {
1636
		$this->assertRepoDefined();
1637
		$ext = $this->getExtension();
1638
		$path = $this->repo->getZoneUrl( 'public', $ext ) . '/archive/' . $this->getHashPath();
1639
		if ( $suffix === false ) {
1640
			$path = substr( $path, 0, -1 );
1641
		} else {
1642
			$path .= rawurlencode( $suffix );
1643
		}
1644
1645
		return $path;
1646
	}
1647
1648
	/**
1649
	 * Get the URL of the archived file's thumbs, or a particular thumb if $suffix is specified
@@ 1655-1667 (lines=13) @@
1652
	 * @param bool|string $suffix If not false, the name of a thumbnail file
1653
	 * @return string
1654
	 */
1655
	function getArchiveThumbUrl( $archiveName, $suffix = false ) {
1656
		$this->assertRepoDefined();
1657
		$ext = $this->getExtension();
1658
		$path = $this->repo->getZoneUrl( 'thumb', $ext ) . '/archive/' .
1659
			$this->getHashPath() . rawurlencode( $archiveName ) . "/";
1660
		if ( $suffix === false ) {
1661
			$path = substr( $path, 0, -1 );
1662
		} else {
1663
			$path .= rawurlencode( $suffix );
1664
		}
1665
1666
		return $path;
1667
	}
1668
1669
	/**
1670
	 * Get the URL of the zone directory, or a particular file if $suffix is specified
@@ 1729-1739 (lines=11) @@
1726
	 * @param bool|string $suffix If not false, the name of a thumbnail file
1727
	 * @return string
1728
	 */
1729
	function getArchiveVirtualUrl( $suffix = false ) {
1730
		$this->assertRepoDefined();
1731
		$path = $this->repo->getVirtualUrl() . '/public/archive/' . $this->getHashPath();
1732
		if ( $suffix === false ) {
1733
			$path = substr( $path, 0, -1 );
1734
		} else {
1735
			$path .= rawurlencode( $suffix );
1736
		}
1737
1738
		return $path;
1739
	}
1740
1741
	/**
1742
	 * Get the virtual URL for a thumbnail file or directory