|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.knowgate.dataobjs.DBPersist
com.knowgate.hipergate.ProductLocation
public class ProductLocation
Product Location
Location semantics depend upon what Product is used for.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Field Summary | |
|---|---|
static short |
ClassId
|
static int |
CONTAINER_FILE
|
static int |
CONTAINER_FTP
|
static int |
CONTAINER_HTTP
|
static int |
CONTAINER_HTTPS
|
static int |
CONTAINER_JDBC
|
static int |
CONTAINER_LOTUS
|
static int |
CONTAINER_ODBC
|
static int |
CONTAINER_WARE
|
| Fields inherited from class com.knowgate.dataobjs.DBPersist |
|---|
AllVals, sAuditCls, sAuditUsr, sTransactId |
| Constructor Summary | |
|---|---|
ProductLocation()
|
|
ProductLocation(JDCConnection oConn,
java.lang.String iIdLocation)
Load ProductLocation from database |
|
| Method Summary | |
|---|---|
boolean |
delete(JDCConnection oConn)
Delete Productocation If ProductLocation URL point to a file that does not exist then an SQLException will be raised. |
int |
getContainerType()
Get numeric identifier for container type. |
java.lang.String |
getPath()
Get Path to URL or file |
java.lang.String |
getProductType()
Get product type from file path. |
java.lang.String |
getURL()
Get URL for ProductLocation |
boolean |
rename(JDCConnection oConn,
FileSystem oFileSys,
java.lang.String sNewFile)
Rename a Product Location This method updates the xfile value from table k_prod_locats and changes the physical file name accordingly |
void |
setLength(int iLen)
Set file length in bytes |
void |
setLength(long lLen)
Set file length in bytes Max file length is 2147483647 bytes |
void |
setPath(java.lang.String sHost,
java.lang.String sLocalPath)
Set Local Path for ProductLocation File Separator is taken from System.getProperty("file.separator") method. |
void |
setPath(java.lang.String sProtocol,
java.lang.String sHost,
java.lang.String sPath,
java.lang.String sFile,
java.lang.String sOriginalFile)
Set File Path |
void |
setPath(java.lang.String sProtocol,
java.lang.String sHost,
java.lang.String sPath,
java.lang.String sFile,
java.lang.String sOriginalFile,
java.lang.String sAnchor)
Set File Path |
void |
setURL(java.lang.String sURL)
Set URL for ProductLocation |
boolean |
store(JDCConnection oConn)
Store ProductLocation Properties gu_location, dt_uploaded, dt_modified, id_cont_type, id_prod_type, pg_prod_locat and status are automatically set if not present at internal properties colelction when calling store(). |
void |
upload(JDCConnection oConn,
FileSystem oFileSys,
java.lang.String sSourcePath,
java.lang.String sSourceFile,
java.lang.String sTargetPath,
java.lang.String sTargetFile)
Move a File from a temporary directory up to the final location referenced by ProductLocation URL. |
| Methods inherited from class com.knowgate.dataobjs.DBPersist |
|---|
allcaps, allcaps, changelog, clear, clone, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getIntervalPart, getItemMap, getItems, getMoney, getShort, getSQLDate, getSQLTime, getString, getStringHtml, getStringNull, getTable, getTable, getTableName, getTime, getTimeOfDay, getTimestamp, getUIdFromName, isEmpty, isNull, iterator, keySet, load, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, replace, replace, replace, replace, setAuditTransact, setAuditUser, setCreationDate, size, toLowerCase, toUpperCase, toXML, toXML, toXML, toXML, values |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Field Detail |
|---|
public static final short ClassId
public static final int CONTAINER_FILE
public static final int CONTAINER_HTTP
public static final int CONTAINER_HTTPS
public static final int CONTAINER_FTP
public static final int CONTAINER_ODBC
public static final int CONTAINER_LOTUS
public static final int CONTAINER_JDBC
public static final int CONTAINER_WARE
| Constructor Detail |
|---|
public ProductLocation()
public ProductLocation(JDCConnection oConn,
java.lang.String iIdLocation)
throws java.sql.SQLException
oConn - Database ConenctioniIdLocation - GUID of ProductLocation to be loaded
java.sql.SQLException| Method Detail |
|---|
public java.lang.String getPath()
Get Path to URL or file
public java.lang.String getURL()
public int getContainerType()
Get numeric identifier for container type.
Usually, container type is computed from protocol.| Protocol | Container Type |
| file:// | CONTAINER_FILE |
| http:// | CONTAINER_HTTP |
| https:// | CONTAINER_HTTPS |
| ftp:// | CONTAINER_FTP |
| odbc:// | CONTAINER_ODBC |
| lotus:// | CONTAINER_LOTUS |
| jdbc:// | CONTAINER_JDBC |
| ware:// | CONTAINER_WARE |
public java.lang.String getProductType()
Get product type from file path.
public void setURL(java.lang.String sURL)
throws java.net.MalformedURLException
Set URL for ProductLocation
java.net.MalformedURLException
public void setLength(long lLen)
throws java.lang.IllegalArgumentException
Set file length in bytes
Max file length is 2147483647 bytes
lLen - Length of file pointed by ProductLocation URL
java.lang.IllegalArgumentException - If lLen > 2147483647public void setLength(int iLen)
Set file length in bytes
lLen - Length of file pointed by ProductLocation URL
public void setPath(java.lang.String sProtocol,
java.lang.String sHost,
java.lang.String sPath,
java.lang.String sFile,
java.lang.String sOriginalFile)
Set File Path
sProtocol - Protocol. One of { "file://", "http://", "https://", "ftp://", "odbc://", "jdbc://", "ware://" }sHost - Host Name for electronic Products or WareHouse Name for physical Products. Example: "www.hipergate.org"sPath - Absolute Access Path. Example: "/opt/knowgate/users/"sFile - Uploaded File NamesOriginalFile - Original File Name before uploading.
In some cases, files may be renamed upon upload and then renamed again to their original names when downloaded.
public void setPath(java.lang.String sProtocol,
java.lang.String sHost,
java.lang.String sPath,
java.lang.String sFile,
java.lang.String sOriginalFile,
java.lang.String sAnchor)
Set File Path
sProtocol - Protocol. One of { "file://", "http://", "https://", "ftp://", "odbc://", "jdbc://", "ware://" }sHost - Host Name for electronic Products or WareHouse Name for physical Products. Example: "www.hipergate.org"sPath - Absolute Access Path. Example: "/opt/knowgate/users/"sFile - Uploaded File NamesOriginalFile - Original File Name before uploading.
In some cases, files may be renamed upon upload and then renamed again to their original names when downloaded.sAnchor - Anchor
public void setPath(java.lang.String sHost,
java.lang.String sLocalPath)
Set Local Path for ProductLocation
File Separator is taken from System.getProperty("file.separator") method.
sHost - Host NamesLocalPath - Full Local Path and File Name.
public boolean store(JDCConnection oConn)
throws java.sql.SQLException
Store ProductLocation
Properties gu_location, dt_uploaded, dt_modified, id_cont_type, id_prod_type, pg_prod_locat and status are automatically set if not present at internal properties colelction when calling store().
store in class DBPersistoConn - Database Connection
java.sql.SQLException
public boolean rename(JDCConnection oConn,
FileSystem oFileSys,
java.lang.String sNewFile)
throws java.lang.Exception,
java.io.IOException,
java.sql.SQLException,
java.lang.SecurityException
Rename a Product Location
This method updates the xfile value from table k_prod_locats and changes the physical file name accordingly
oConn - Database connectionoFileSys - FileSystem Object for accessing physical filesNewFile - New file name
java.lang.Exception
java.io.IOException
java.sql.SQLException
java.lang.SecurityException
public void upload(JDCConnection oConn,
FileSystem oFileSys,
java.lang.String sSourcePath,
java.lang.String sSourceFile,
java.lang.String sTargetPath,
java.lang.String sTargetFile)
throws java.lang.Exception,
java.io.IOException,
java.sql.SQLException
oConn - Database ConnectionoFileSys - FileSystem object used for moving the file.sSourcePath - Source Directory. For example: "file:///tmp/archivos/"sSourceFile - Original File Name. For example: "notes.pdf"sTargetPath - Target Directory. For example: "ftp://saturno/opt/storage/"sTargetFile - Final File Name. For Example: "notes-13-05-03.pdf"
java.lang.Exception
java.io.IOException
java.sql.SQLExceptionEnvironment
public boolean delete(JDCConnection oConn)
throws java.sql.SQLException
Delete Productocation
If ProductLocation URL point to a file that does not exist then an SQLException will be raised.
delete in class DBPersistoConn - Database Connection
java.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||