public class S_MediaBfileServer extends Object
Modifier and Type | Field and Description |
---|---|
protected static int |
SUCCESS
Error code to indicate a successful operation.
|
Constructor and Description |
---|
S_MediaBfileServer() |
Modifier and Type | Method and Description |
---|---|
static int |
createBfileFromBfile(String[] error,
String contentTableName,
String columnName,
Long cid,
Long mediaId,
Long partitionValue,
String basePath,
String relativePath,
String fileName,
oracle.sql.BFILE bfile,
int bufferSize)
Creates a BFILE from another BFILE.
|
static int |
createBfileFromBlob(String[] error,
String contentTableName,
String columnName,
Long cid,
Long mediaId,
Long partitionValue,
String basePath,
String relativePath,
String fileName,
oracle.sql.BLOB blob,
int bufferSize)
Creates a BFILE from a BLOB.
|
static int |
createBfileFromContentReference(String[] error,
String contentTableName,
String columnName,
Long cid,
Long mediaId,
Long partitionValue,
String basePath,
String contentReference)
Creates a BFILE from a content reference.
|
static void |
deleteFilesInDefaultDirectory()
Deletes files in default BFILE directory for this schema created by a
previous installation into this schema.
|
static int |
destroyContent(String[] error,
String contentTableName,
String columnName,
Long cid,
int deleteFileRule)
Destroys a BFILE.
|
static void |
dropDirectoryObjects()
Drops DIRECTORY objects created by a previous installation into this
schema.
|
static String |
getAbsolutePath(String path)
Gets an absolute path, on the database-tier file system, for the specified
path.
|
static String |
getCanonicalPath(String path)
Converts a specified path to a canonical absolute path.
|
static void |
updateMediaBfileBasePath()
Sets the BASEPATH of all MediaBfile instances to
$ORACLE_HOME/ifsbfiles/schemaName , where
schemaName is the lower-cased schema name. |
protected static final int SUCCESS
public static int createBfileFromBfile(String[] error, String contentTableName, String columnName, Long cid, Long mediaId, Long partitionValue, String basePath, String relativePath, String fileName, oracle.sql.BFILE bfile, int bufferSize)
error
- a String[1] into which the backtrace of any
error is writtencontentTableName
- the content table namecolumnName
- the content table column namecid
- the content idmediaId
- the media idpartitionValue
- the partition value, or null if nonebasePath
- the BASEPATH of the MediaBfile instancerelativePath
- the path to the content directory, relative to
the base pathfileName
- the file namebfile
- the source BFILEbufferSize
- the maximum buffer size, in bytespublic static int createBfileFromBlob(String[] error, String contentTableName, String columnName, Long cid, Long mediaId, Long partitionValue, String basePath, String relativePath, String fileName, oracle.sql.BLOB blob, int bufferSize)
error
- a String[1] into which the backtrace of any
error is writtencontentTableName
- the content table namecolumnName
- the content table column namecid
- the content idmediaId
- the media idpartitionValue
- the partition value, or null if nonebasePath
- the BASEPATH of the MediaBfile instancerelativePath
- the path to the content directory, relative to
the base pathfileName
- the file nameblob
- the BLOBbufferSize
- the maximum buffer size, in bytespublic static int createBfileFromContentReference(String[] error, String contentTableName, String columnName, Long cid, Long mediaId, Long partitionValue, String basePath, String contentReference)
error
- a String[1] into which the backtrace of any
error is writtencontentTableName
- the content table namecolumnName
- the content table column namecid
- the content idmediaId
- the media idpartitionValue
- the partition value, or null if nonebasePath
- the BASEPATH of the MediaBfile instancecontentReference
- the content referencepublic static int destroyContent(String[] error, String contentTableName, String columnName, Long cid, int deleteFileRule)
error
- a String[1] into which the backtrace of any
error is writtencontentTableName
- the content table namecolumnName
- the content table column namecid
- the content iddeleteFileRule
- 0 to retain the operating system file referenced
by the BFILE; 1 to delete itpublic static String getAbsolutePath(String path)
path
- a path, or nullpath
; if
path
is already an absolute path it is
returned unchanged; returns null if path
is nullpublic static void dropDirectoryObjects() throws SQLException
As a safeguard, this method may only be called before the MediaBfile classobject is created.
IllegalStateException
- if the MediaBfile classobject existsSQLException
- if the operation otherwise failspublic static void deleteFilesInDefaultDirectory() throws SQLException, IOException
This method is only used in the development environment. As a safeguard,
this method may only be called if there are no DIRECTORY objects for this
schema. Only files with synthetic names (that is, whose names start with
"oracle_ifs_
") are deleted.
IllegalStateException
- if a DIRECTORY object exists for this schemaSQLException
- if the operation failsIOException
- if the operation failspublic static void updateMediaBfileBasePath() throws SQLException, IOException
$ORACLE_HOME/ifsbfiles/schemaName
, where
schemaName
is the lower-cased schema name.
This method is only used in the development environment. As a safeguard, this method may only be called if there are no DIRECTORY objects for this schema.
IllegalStateException
- if a DIRECTORY object exists for this schemaSQLException
- if the operation failsIOException
- if the operation failspublic static String getCanonicalPath(String path)
Used during schema upgrade by StorageMigrateHsmContent.
path
- a relative or absolute pathCopyright © 2023. All rights reserved.