Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.workareas
Class FileSystemWorkArea

    java.lang.Object
      com.knowgate.dfs.FileSystem
          com.knowgate.workareas.FileSystemWorkArea

    public class FileSystemWorkArea

extends FileSystem

Field Summary

Fields inherited from class com.knowgate.dfs.FileSystem
`OS_PUREJAVA, OS_UNIX, OS_WINDOWS, SLASH`

Constructor Summary
`FileSystemWorkArea(java.util.Properties oEnvProps)`

Method Summary
`java.lang.String` | `getstorpath(java.util.Properties oProps, int iDomain, java.lang.String sWorkArea)` Get base path for storage at given domain and work area /$storage$/domains/iDomain/workareas/sWorkArea/
`boolean` | `mkstorpath(int iDomain, java.lang.String sWorkArea, java.lang.String sPath)` Create a complete directory branch under storage root directory The given path is appended to storage/domains/iDomain/workareas/sWorkArea/ and the full resulting path is created if it does not exist.
`boolean` | `mkworkpath(java.lang.String sWorkArea)` Create workarea root directory at /web branch
`boolean` | `mkworkpath(java.lang.String sWorkArea, java.lang.String sPath)` Create a complete directory branch under workarea root directory.
`java.lang.String` | `readstorfilestr(int iDomain, java.lang.String sWorkArea, java.lang.String sPath, java.lang.String sEncoding)` Read text file under storage root directory using given encoding
`java.lang.String` | `readstorfilestr(java.lang.String sPath, java.lang.String sEncoding)` Read text file under storage root directory using given encoding
`java.lang.String` | `readworkfilestr(java.lang.String sWorkArea, java.lang.String sPath, java.lang.String sEncoding)` Read text file under workarea root directory
`boolean` | `rmstorpath(int iDomain, java.lang.String sWorkArea)` Remove workarea files under /storage branch
`boolean` | `rmstorpath(int iDomain, java.lang.String sWorkArea, java.lang.String sPath)` Remove workarea files under /storage branch
`boolean` | `rmworkpath(java.lang.String sWorkArea)` Delete workarea root directory at /web branch.
`boolean` | `rmworkpath(java.lang.String sWorkArea, java.lang.String sPath)` Delete a directory and all its subdirectories and files under workarea root directory at /web branch.
`void` | `writestorfilestr(int iDomain, java.lang.String sWorkArea, java.lang.String sPath, java.lang.String sText, java.lang.String sEncoding)` Write a String to a text file under storage root directory using given encoding
`void` | `writeworkfilestr(java.lang.String sWorkArea, java.lang.String sPath, java.lang.String sText, java.lang.String sEncoding)` Write a String to a text file under workarea root directory using given encoding

Methods inherited from class com.knowgate.dfs.FileSystem
`convert, copy, delete, delete, detectEncoding, detectEncoding, downloadhtmlpage, exists, file, filelen, host, mkdirs, move, os, password, password, path, readfile, readfile, readfilebin, readfileobj, readfilestr, realm, rename, rmdir, splitURI, user, user, writefilebin, writefileobj, writefilestr`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FileSystemWorkArea

    public FileSystemWorkArea(java.util.Properties oEnvProps)

Method Detail

### readworkfilestr

    public java.lang.String readworkfilestr(java.lang.String sWorkArea,
                                            java.lang.String sPath,
                                            java.lang.String sEncoding)
                                     throws java.lang.IllegalArgumentException,
                                            java.io.IOException,
                                            java.lang.OutOfMemoryError

  Read text file under workarea root directory

  Parameters:
    `sWorkArea` - WorkArea GUID
    `sPath` - Relative path to file under workarea root directory at /web branch including file name. For example "apps/Shop/change.log"
    `sEncoding` - Encoding to be used see Java Supported Encodings
  Throws:
    `java.lang.IllegalArgumentException` - if sWorkArea or sPath is null
    `java.io.IOException`
    `java.lang.OutOfMemoryError`
  Since:
    4.0

### writeworkfilestr

    public void writeworkfilestr(java.lang.String sWorkArea,
                                 java.lang.String sPath,
                                 java.lang.String sText,
                                 java.lang.String sEncoding)
                          throws java.lang.IllegalArgumentException,
                                 java.io.IOException,
                                 java.lang.OutOfMemoryError

  Write a String to a text file under workarea root directory using given encoding

  Parameters:
    `sWorkArea` - WorkArea GUID
    `sPath` - Relative path to file under workarea root directory at /web branch including file name. For example "apps/Shop/change.log"
    `sText` - String to be written
    `sEncoding` - Encoding to be used see Java Supported Encodings
  Throws:
    `java.lang.IllegalArgumentException` - if sWorkArea or sPath is null
    `java.io.IOException`
    `java.lang.OutOfMemoryError`
  Since:
    4.0

### readstorfilestr

    public java.lang.String readstorfilestr(java.lang.String sPath,
                                            java.lang.String sEncoding)
                                     throws java.lang.IllegalArgumentException,
                                            java.io.IOException,
                                            com.enterprisedt.net.ftp.FTPException,
                                            java.lang.OutOfMemoryError

  Read text file under storage root directory using given encoding

  Parameters:
    `sPath` - Relative path to file under storage root directory including file name. For example "cache/recent.html"
    `sEncoding` - Encoding to be used see Java Supported Encodings
  Throws:
    `java.lang.IllegalArgumentException` - if sWorkArea or sPath is null
    `java.io.IOException`
    `java.lang.OutOfMemoryError`
    `com.enterprisedt.net.ftp.FTPException`
  Since:
    6.0

### readstorfilestr

    public java.lang.String readstorfilestr(int iDomain,
                                            java.lang.String sWorkArea,
                                            java.lang.String sPath,
                                            java.lang.String sEncoding)
                                     throws java.lang.IllegalArgumentException,
                                            java.io.IOException,
                                            com.enterprisedt.net.ftp.FTPException,
                                            java.lang.OutOfMemoryError

  Read text file under storage root directory using given encoding

  Parameters:
    `iDomain` - Domain Numeric Identifier
    `sWorkArea` - WorkArea GUID
    `sPath` - Relative path to file under storage root directory including file name. For example "cache/recent.html"
    `sEncoding` - Encoding to be used see Java Supported Encodings
  Throws:
    `java.lang.IllegalArgumentException` - if sWorkArea or sPath is null
    `java.io.IOException`
    `java.lang.OutOfMemoryError`
    `com.enterprisedt.net.ftp.FTPException`
  Since:
    4.0

### writestorfilestr

    public void writestorfilestr(int iDomain,
                                 java.lang.String sWorkArea,
                                 java.lang.String sPath,
                                 java.lang.String sText,
                                 java.lang.String sEncoding)
                          throws java.lang.IllegalArgumentException,
                                 java.io.IOException,
                                 com.enterprisedt.net.ftp.FTPException,
                                 java.lang.OutOfMemoryError

  Write a String to a text file under storage root directory using given encoding

  Parameters:
    `iDomain` - Domain Numeric Identifier
    `sWorkArea` - WorkArea GUID
    `sPath` - Relative path to file under storage root directory including file name. For example "cache/recent.html"
    `sText` - String to be written
    `sEncoding` - Encoding to be used see Java Supported Encodings
  Throws:
    `java.lang.IllegalArgumentException` - if sWorkArea or sPath is null
    `java.io.IOException`
    `java.lang.OutOfMemoryError`
    `com.enterprisedt.net.ftp.FTPException`
  Since:
    4.0

### mkworkpath

    public boolean mkworkpath(java.lang.String sWorkArea,
                              java.lang.String sPath)
                       throws java.lang.Exception,
                              java.io.IOException

  Create a complete directory branch under workarea root directory.

  The given path is appended to "file://" + workareasput + sWorkArea and the full resulting path is created if it does not exist.

  Parameters:
    `sWorkArea` - WorkArea GUID
    `sPath` - Relative path to be created under workareas root directory
  Throws:
    `java.io.IOException`
    `java.lang.IllegalArgumentException` - If sWorkArea is null
    `java.lang.Exception`

### mkworkpath

    public boolean mkworkpath(java.lang.String sWorkArea)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException

  Create workarea root directory at /web branch

  Parameters:
    `oProps` - Properties collection containing workareasput property
    `sWorkArea` - WorkArea GUID
  Throws:
    `java.lang.IllegalArgumentException` - If sWorkArea is null
    `java.io.IOException`

### rmworkpath

    public boolean rmworkpath(java.lang.String sWorkArea,
                              java.lang.String sPath)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException

  Delete a directory and all its subdirectories and files under workarea root directory at /web branch.

  The given path is appended to "file://" + workareasput + sWorkArea, the resulting directory and all its childs are deleted.

  Parameters:
    `sWorkArea` - WorkArea GUID
    `sPath` - Relative path to be created under workareas root directory
  Throws:
    `java.io.IOException`
    `java.lang.IllegalArgumentException` - If sWorkArea is null

### rmworkpath

    public boolean rmworkpath(java.lang.String sWorkArea)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException

  Delete workarea root directory at /web branch.

  The given path is appended to "file://" + workareasput + , the resulting directory and all its childs are deleted.

  Parameters:
    `sWorkArea` - WorkArea GUID
  Throws:
    `java.io.IOException`
    `java.lang.IllegalArgumentException` - If sWorkArea is null

### getstorpath

    public java.lang.String getstorpath(java.util.Properties oProps,
                                        int iDomain,
                                        java.lang.String sWorkArea)
                                 throws java.lang.IllegalArgumentException

  Get base path for storage at given domain and work area

  /$storage$/domains/iDomain/workareas/sWorkArea/

  Parameters:
    `oProps` - Properties collection containing storage property (typically readed from file hipergate.cnf)
    `iDomain` - Domain Numeric Identifier
    `sWorkArea` - WorkArea GUID
  Throws:
    `java.lang.IllegalArgumentException` - If sWorkArea is null
  Since:
    6.0

### mkstorpath

    public boolean mkstorpath(int iDomain,
                              java.lang.String sWorkArea,
                              java.lang.String sPath)
                       throws java.lang.Exception,
                              java.io.IOException

  Create a complete directory branch under storage root directory

  The given path is appended to storage/domains/iDomain/workareas/sWorkArea/ and the full resulting path is created if it does not exist.

  Parameters:
    `iDomain` - Domain Numeric Identifier
    `sWorkArea` - WorkArea GUID
    `sPath` - Relative path to be created under workarea directory. For example: "ROOT/DOMAINS/TEST1/TEST1_USERS/TEST1_administrator/TEST1_administrator_temp" If sPath is null hen the workarea root directory itself will be created.
  Throws:
    `java.io.IOException`
    `java.lang.IllegalArgumentException` - If sWorkArea is null
    `java.lang.Exception`

### rmstorpath

    public boolean rmstorpath(int iDomain,
                              java.lang.String sWorkArea,
                              java.lang.String sPath)
                       throws java.lang.Exception,
                              java.io.IOException

  Remove workarea files under /storage branch

  Parameters:
    `iDomain` - Domain Numeric Identifier
    `sWorkArea` - WorkArea GUID
    `sPath` - Relative path from workarea subdirectory to delete.
  Throws:
    `java.lang.Exception`
    `java.io.IOException`

### rmstorpath

    public boolean rmstorpath(int iDomain,
                              java.lang.String sWorkArea)
                       throws java.lang.Exception,
                              java.io.IOException

  Remove workarea files under /storage branch

  Parameters:
    `iDomain` - Domain Numeric Identifier
    `sWorkArea` - WorkArea GUID
  Throws:
    `java.lang.Exception`
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD