TODO: Versions may have a different content type than the original, such as the first-frame still image for a video file. This means that a resource may be access by different extensions, even for original unqualified: xyz.mp4 would redirect to original version video xyz.jpg would redirect to version of first frame at original video size xyz-(width)x(height).mp4 would be scaled video xyz-(width)x(height).jpg would be scaled first frame
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the CDN this resource is part of.getId()
Gets the unique identifier for this resource.Gets the original version of this resource by following the original symlink and parsing the filename.Determines the original content type by looking for the "original.Gets all versions of this resource.getVersions
(ContentType contentType) Gets all versions of this resource, optionally filtered by content type.int
hashCode()
toString()
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
getCdnData
Gets the CDN this resource is part of. -
getId
Gets the unique identifier for this resource. -
getVersions
Gets all versions of this resource, optionally filtered by content type.- Parameters:
contentType
- The optional content type to filter for ornull
for any content type- Throws:
IOException
-
getVersions
Gets all versions of this resource.- Throws:
IOException
-
getOriginalContentType
Determines the original content type by looking for the "original.(extension)" entry. This is expected to be a symlink to the scaled name pattern, but this is not specifically checked; only filenames are scanned.Resource locking not performed since the original version is created for a new resource then effectively immutable (never modified).
- Throws:
IllegalArgumentException
- When unable to determine the content typeIOException
-
getOriginal
Gets the original version of this resource by following the original symlink and parsing the filename.No resource locking required since the original version is created for a new resource then effectively immutable (never modified).
- Throws:
IOException
-