Class FileURN

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Direct Known Subclasses:
    ImageURN

    public class FileURN
    extends URNResource
    implements java.lang.Cloneable, java.io.Serializable
    File Uniform Resource Naming (URN) instance class, holding a file name referencing a resource type with an identifier. The identifier is a Long or a String value depending on the resource type.
    Author:
    Christopher Mindus
    See Also:
    URN, URNResourceType, Serialized Form
    • Constructor Detail

      • FileURN

        protected FileURN​(java.lang.String urnString,
                          URNResourceType type,
                          java.lang.Object id)
        Constructor using default width, height and default (L = ~7%) error correction level (QR code).
        Parameters:
        urnString - The full URN String.
        type - The URN resource type.
        id - The URN resource ID for the type: a Long or a String depending of the type.
    • Method Detail

      • fromFileResource

        public static FileURN fromFileResource​(URNResourceType type,
                                               java.lang.Object id)
                                        throws java.net.MalformedURLException,
                                               MalformedURNException
        Creates a File URN from a string.
        Parameters:
        type - The URN resource type.
        id - The URN resource ID for the type: a Long or a String depending of the type.
        Throws:
        java.lang.NullPointerException - If the url is null.
        IllegalArgumentExecption - If the class of the id parameter does not match the type URNResourceType parameter. Currently, only {code Long} and {code String} values are allowed.
        java.net.MalformedURLException - If the url is malformed.
        MalformedURNException - If the url is malformed for an iizi URN URL.