Package com.iizix.urn.file
Class FileURNFactory
java.lang.Object
com.iizix.urn.file.FileURNFactory
- All Implemented Interfaces:
- IFileURNProvider,- IURNProvider
The File URN provider depends on the 
URNResourceType and an identifier, where the identifier is either a String for URNResourceType.File URN's are encoded in IIZI as:
urn:iz-file:type:identifier
where the valid {code type}s are (in lower case):
- {@link URNResourceType#COMMON_DATABASE_PERSISTENT}: Common server files stored in database (cached on the server even for starts/stops),
- {@link URNResourceType#COMMON_PERSISTENT}: Common server files (persists when server starts/stops),
- {@link URNResourceType#COMMON_VOLATILE}: Common server files (volatile when server starts/stops),
- {@link URNResourceType#EXTERNAL_FILES}: External files (typically accessible using the 'file:' protocol),
- {@link URNResourceType#APPLICATION_DATABASE_PERSISTENT}: Application files in database,
- {@link URNResourceType#APPLICATION_PERSISTENT}: Application files,
- {@link URNResourceType#APPLICATION_VOLATILE}: Application files,
- {@link URNResourceType#GROUP_DATABASE_FILES}: Private user group files stored in database (cached on server),
- {@link URNResourceType#USER_FILES}: Private user files,
- {@link URNResourceType#USER_DATABASE_FILES}: Private user files stored in database (cached on server),
- {@link URNResourceType#APP_SESSION}: Application session files,
- {@link URNResourceType#CLIENT_SESSION}: Client session files.
The identifier is file identifier in the type identifier.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- static FileURNFactoryGets the singleton instance of the File URN factory.- getNID()Gets the Naming IDentifier of the provider.Gets the URN Resource Type supported by the provider.- static void- initialize- (URNFactory factory, IFileURNProvider provider) Initializes the File URN factory.Parses the URN after the NID specification, i.e.- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait- Methods inherited from interface com.iizix.urn.IURNProvider- paramString0
- Method Details- initializeInitializes the File URN factory.- Parameters:
- factory- The main URN factory.
- provider- The file provider.
 
- getInstanceGets the singleton instance of the File URN factory.- Returns:
- The File URN factory instance, or nullif not yet initialized.
 
- getResourceTypesGets the URN Resource Type supported by the provider.- Specified by:
- getResourceTypesin interface- IURNProvider
- Returns:
- The supported resource type, empty list when not resource based.
 
- getNIDGets the Naming IDentifier of the provider.- Specified by:
- getNIDin interface- IURNProvider
- Returns:
- The NID.FILE.
 
- parsepublic FileURN parse- (String urnString, String nss, String req, String query, String fragment) throws URNException Parses the URN after the NID specification, i.e. after "urn:NID:".- Specified by:
- parsein interface- IURNProvider
- Parameters:
- urnString- The full unparsed original URN string.
- nss- The NSS part of the string (before request/query/fragment).
- req- The decoded request String (without "?+"),- nullfor none.
- query- The decoded query String (without "?="),- nullfor none.
- fragment- The decoded fragment,- nullfor none.
- Returns:
- The URN instance.
- Throws:
- URNException- For URN exceptions.
- IllegalArgumentException- If the "NSS" part of the string is not a valid type, followed by a valid ID.