public class FileNameHandlerExtWrapper extends java.lang.Object implements FilenameHandlerExtIF
FilenameHandlerExtIF
interface.
When the CFS tries to instanciate the FileNameHandler class that is configured
in the runtime properties, it will use a wrapper when the class does not
implement the FilenameHandlerExtIF
interface itself. This is to
support the new functionality with older FileNameHandler classes.Constructor and Description |
---|
FileNameHandlerExtWrapper(FilenameHandlerIF handler)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
delete(java.io.File file)
Delete an unused file.
|
java.io.File |
getFile(AoSession aoSession,
java.lang.String name,
java.lang.String subdir)
Get a file for the given initial name.
|
java.io.File |
getFileForInstance(AoSession aoSession,
java.lang.String name,
java.lang.String subDir,
T_LONGLONG aid,
T_LONGLONG iid)
Create a file for the given initial name and depending on the given ids.
|
java.io.File |
getFileForInstanceName(AoSession aoSession,
java.lang.String name,
java.lang.String subDir,
java.lang.String aeName,
java.lang.String ieName)
Create a file for the given initial name and depending on the given names.
|
java.io.File |
getFileFromURL(AoSession aoSession,
java.lang.String url)
Get the local file from given URL string.
|
java.io.File |
getFileFromURL(java.lang.String url)
Get the local file from given URL string.
|
java.lang.String |
getURLFromFile(AoSession aoSession,
java.io.File file)
Create a URL string used by the ASAM ODS client to store into the AoExternalReference url value.
|
java.lang.String |
getURLFromFile(java.io.File file)
Create a URL string used by the ASAM ODS client to store into the AoExternalReference url value.
|
java.io.File |
move(java.io.File file)
Move an unused file.
|
public FileNameHandlerExtWrapper(FilenameHandlerIF handler)
FilenameHandlerIF
implementation
as parameter. This object will be wrapped by this Wrapper.handler
- the actual FilenameHandler implementationpublic java.io.File getFile(AoSession aoSession, java.lang.String name, java.lang.String subdir) throws CORBAFileServerException
getFile
in interface FilenameHandlerIF
aoSession
- the ASAM ODS session.name
- the name of the file.subdir
- the subdirectory, if the filename should not be used to get the subfolder.CORBAFileServerException
- with the following possible error codes:
FILESERVER_CONNECT_FAILED
FILESERVER_BAD_PARAMETER
FILESERVER_CONNECTION_LOST
FILESERVER_IMPLEMENTATION_PROBLEM
FILESERVER_NOT_IMPLEMENTED
FILESERVER_NO_MEMORY
FILESERVER_ASAMODS_EXCEPTIONpublic java.io.File getFileForInstance(AoSession aoSession, java.lang.String name, java.lang.String subDir, T_LONGLONG aid, T_LONGLONG iid) throws CORBAFileServerException
getFileForInstance
in interface FilenameHandlerIF
aoSession
- the ASAM ODS Sessionname
- the name of the file.subDir
- the subdirectory, if the filename should not be used to get the subfolder.aid
- the application element id.iid
- the instance element id.CORBAFileServerException
- with the following possible error codes:
FILESERVER_CONNECT_FAILED
FILESERVER_BAD_PARAMETER
FILESERVER_CONNECTION_LOST
FILESERVER_IMPLEMENTATION_PROBLEM
FILESERVER_NOT_IMPLEMENTED
FILESERVER_NO_MEMORY
FILESERVER_ASAMODS_EXCEPTIONpublic java.io.File getFileForInstanceName(AoSession aoSession, java.lang.String name, java.lang.String subDir, java.lang.String aeName, java.lang.String ieName) throws CORBAFileServerException
getFileForInstanceName
in interface FilenameHandlerIF
aoSession
- the ASAM ODS Sessionname
- the name of the file.subDir
- the subdirectory, if the filename should not be used to get the subfolder.aeName
- the application element name.ieName
- the instance element name.CORBAFileServerException
- with the following possible error codes:
FILESERVER_CONNECT_FAILED
FILESERVER_BAD_PARAMETER
FILESERVER_CONNECTION_LOST
FILESERVER_IMPLEMENTATION_PROBLEM
FILESERVER_NOT_IMPLEMENTED
FILESERVER_NO_MEMORY
FILESERVER_ASAMODS_EXCEPTIONpublic java.lang.String getURLFromFile(java.io.File file) throws java.io.IOException, CORBAFileServerException
getURLFromFile
in interface FilenameHandlerIF
file
- the local filejava.io.IOException
CORBAFileServerException
public java.io.File getFileFromURL(java.lang.String url) throws java.io.IOException, CORBAFileServerException
getFileFromURL
in interface FilenameHandlerIF
url
- the url stringjava.io.IOException
CORBAFileServerException
public void delete(java.io.File file) throws java.io.IOException, CORBAFileServerException
delete
in interface FilenameHandlerIF
file
- the file that may be deleted.java.io.IOException
CORBAFileServerException
public java.io.File move(java.io.File file) throws java.io.IOException, CORBAFileServerException
move
in interface FilenameHandlerIF
file
- the result file.java.io.IOException
CORBAFileServerException
public java.lang.String getURLFromFile(AoSession aoSession, java.io.File file) throws CORBAFileServerException
getURLFromFile(File)
method.getURLFromFile
in interface FilenameHandlerExtIF
aoSession
- an AoSession object, may also be null because
this method does not use this parameterfile
- the local fileCORBAFileServerException
- with the following possible error codes:
FILESERVER_CONNECT_FAILED
FILESERVER_BAD_PARAMETER
FILESERVER_CONNECTION_LOST
FILESERVER_IMPLEMENTATION_PROBLEM
FILESERVER_NOT_IMPLEMENTED
FILESERVER_NO_MEMORY
FILESERVER_ASAMODS_EXCEPTIONpublic java.io.File getFileFromURL(AoSession aoSession, java.lang.String url) throws CORBAFileServerException
getFileFromURL
in interface FilenameHandlerExtIF
aoSession
- an AoSession object, may also be null because
this method does not use this parameterurl
- the url stringCORBAFileServerException
- with the following possible error codes:
FILESERVER_CONNECT_FAILED
FILESERVER_BAD_PARAMETER
FILESERVER_CONNECTION_LOST
FILESERVER_IMPLEMENTATION_PROBLEM
FILESERVER_NOT_IMPLEMENTED
FILESERVER_NO_MEMORY
FILESERVER_ASAMODS_EXCEPTION