com.konakartadmin.blif
Interface AdminFileMgrIf

All Known Implementing Classes:
AdminFileMgr

public interface AdminFileMgrIf

AdminFileMgrIf


Method Summary
 boolean deleteFile(java.lang.String fileName)
          Delete the file.
 AdminFile[] getConfigFiles()
          Returns an array containing the configuration files.
 java.lang.String getFileContents(java.lang.String fileName)
          Get the file contents.
 byte[] getFileContentsAsByteArray(java.lang.String fileName)
          Get the file contents as a byte array.
 AdminFile[] getFiles(java.lang.String directory, java.lang.String extension)
          Returns an array of files found in the directory.
 void saveFileContents(java.lang.String fileName, java.lang.String fileContents)
          Writes the specified file contents into the specified file.
 

Method Detail

getFileContents

java.lang.String getFileContents(java.lang.String fileName)
                                 throws KKAdminException
Get the file contents. Note that it uses the line terminators appropriate for the platform where the file resides.

Parameters:
fileName - the filename in the server's context
Returns:
the file contents as a String
Throws:
KKAdminException - if the file's not present or can't be read, or it's not a text file

getFileContentsAsByteArray

byte[] getFileContentsAsByteArray(java.lang.String fileName)
                                  throws KKAdminException
Get the file contents as a byte array.

Parameters:
fileName - the filename in the server's context
Returns:
the file contents as a byte array
Throws:
KKAdminException - if the file's not present or can't be read

saveFileContents

void saveFileContents(java.lang.String fileName,
                      java.lang.String fileContents)
                      throws KKAdminException
Writes the specified file contents into the specified file. It creates the file if it doesn't already exist.

Parameters:
fileName - the filename in the server's context
fileContents - the file contents to write
Throws:
KKAdminException - on any Security or IO problems that prevent us from saving the data to the file.

deleteFile

boolean deleteFile(java.lang.String fileName)
                   throws KKAdminException
Delete the file.

Parameters:
fileName - the filename in the server's context
Returns:
true if the file was deleted, otherwise false.
Throws:
KKAdminException - if the file's not present or can't be deleted

getConfigFiles

AdminFile[] getConfigFiles()
                           throws KKAdminException
Returns an array containing the configuration files.

Returns:
Returns the files defined in konakart-files.xml
Throws:
KKAdminException

getFiles

AdminFile[] getFiles(java.lang.String directory,
                     java.lang.String extension)
                     throws KKAdminException
Returns an array of files found in the directory. If the extension is not null, then the files are filtered by extension.

Parameters:
directory - The directory containing the files
extension - The extension of the files. If null, all files are returned.
Returns:
Returns an array of Admin File objects
Throws:
KKAdminException


Copyright © 2011 DS Data Systems UK Ltd.