org.freehep.application.services.jnlp
Class JNLPFileAccess

java.lang.Object
  extended by org.freehep.application.services.jnlp.JNLPFileAccess
All Implemented Interfaces:
FileAccess

public class JNLPFileAccess
extends Object
implements FileAccess

Implementation of FileAccess for use in unsigned JNLP applications.

Version:
$Id: JNLPFileAccess.java 8584 2006-08-10 23:06:37Z duns $
Author:
tonyj

Constructor Summary
JNLPFileAccess(javax.jnlp.FileContents fc)
          Creates new JNLPFileAccess
 
Method Summary
 boolean canRead()
          Returns whether the file can be read.
 boolean canWrite()
          Returns whether the file can be written to.
 File getFile()
          Applications that need direct access to the underlying File can call this method, but it breaks the JNLP encapsualtion and will throw a SecurityException if used from an unsigned JNLP application.
 InputStream getInputStream()
          Gets an InputStream from the file.
 long getLength()
          Gets the length of the file
 long getMaxLength()
          Gets the maximum length of this file.
 String getName()
          Gets the file name as a string
 OutputStream getOutputStream(boolean append)
          Gets an OutputStream to the file.
 long setMaxLength(long length)
          Sets the maximum file length for the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNLPFileAccess

public JNLPFileAccess(javax.jnlp.FileContents fc)
Creates new JNLPFileAccess

Method Detail

canRead

public boolean canRead()
                throws IOException
Description copied from interface: FileAccess
Returns whether the file can be read.

Specified by:
canRead in interface FileAccess
Throws:
IOException

canWrite

public boolean canWrite()
                 throws IOException
Description copied from interface: FileAccess
Returns whether the file can be written to.

Specified by:
canWrite in interface FileAccess
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: FileAccess
Gets an InputStream from the file.

Specified by:
getInputStream in interface FileAccess
Throws:
IOException

getOutputStream

public OutputStream getOutputStream(boolean append)
                             throws IOException
Description copied from interface: FileAccess
Gets an OutputStream to the file.

Specified by:
getOutputStream in interface FileAccess
Throws:
IOException

getName

public String getName()
               throws IOException
Description copied from interface: FileAccess
Gets the file name as a string

Specified by:
getName in interface FileAccess
Throws:
IOException

getLength

public long getLength()
               throws IOException
Description copied from interface: FileAccess
Gets the length of the file

Specified by:
getLength in interface FileAccess
Throws:
IOException

getMaxLength

public long getMaxLength()
                  throws IOException
Description copied from interface: FileAccess
Gets the maximum length of this file. If the length is not limited returns a very large number

Specified by:
getMaxLength in interface FileAccess
Throws:
IOException

setMaxLength

public long setMaxLength(long length)
                  throws IOException
Description copied from interface: FileAccess
Sets the maximum file length for the file.

Specified by:
setMaxLength in interface FileAccess
Throws:
IOException

getFile

public File getFile()
             throws IOException,
                    SecurityException
Description copied from interface: FileAccess
Applications that need direct access to the underlying File can call this method, but it breaks the JNLP encapsualtion and will throw a SecurityException if used from an unsigned JNLP application.

Specified by:
getFile in interface FileAccess
Throws:
IOException
SecurityException


Copyright © 2000-2006 FreeHEP. All Rights Reserved.