Java Doc for InputStreamFile.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » io » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.impl.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.impl.io.InputStreamFile

All known Subclasses:   org.apache.derby.impl.io.CPFile,  org.apache.derby.impl.io.URLFile,  org.apache.derby.impl.io.JarDBFile,
InputStreamFile
abstract class InputStreamFile implements StorageFile(Code)
This class provides the base for read-only stream implementations of the StorageFile interface. It is used with the classpath, jar, http, and https subsubprotocols


Field Summary
final  intnameStart
    
final  Stringpath
    
final  BaseStorageFactorystorageFactory
    

Constructor Summary
 InputStreamFile(BaseStorageFactory storageFactory, String path)
    
 InputStreamFile(BaseStorageFactory storageFactory, String parent, String name)
    
 InputStreamFile(InputStreamFile dir, String name)
    
 InputStreamFile(BaseStorageFactory storageFactory, String child, int pathLen)
    

Method Summary
public  booleancanWrite()
     Determine whether the named file is writable.
public  booleancreateNewFile()
     If the named file does not already exist then create it as an empty normal file. The implementation must synchronize with other threads accessing the same file (in the same or a different process). If two threads both attempt to create a file with the same name at the same time then at most one should succeed. true if this thread's invocation of createNewFile successfully created the named file;false if not, i.e.
public  booleandelete()
     Deletes the named file or empty directory.
public  booleandeleteAll()
     Deletes the named file and, if it is a directory, all the files and directories it contains.
public  booleanequals(Object other)
    
abstract public  booleanexists()
     Tests whether the named file exists.
public  StringgetCanonicalPath()
    
public  intgetExclusiveFileLock()
     Get an exclusive lock with this name.
abstract public  InputStreamgetInputStream()
     Creates an input stream from a file name.
public  StringgetName()
    
public  OutputStreamgetOutputStream()
     Creates an output stream from a file name.
public  OutputStreamgetOutputStream(boolean append)
     Creates an output stream from a file name.
public  StorageFilegetParentDir()
     Get the name of the parent directory if this name includes a parent.
abstract  StorageFilegetParentDir(int pathLen)
     Get the parent of this file.
public  StringgetPath()
     Converts this StorageFile into a pathname string.
public  StorageRandomAccessFilegetRandomAccessFile(String mode)
     Get a random access file.
Parameters:
  mode - "r", "rw", "rws", or "rwd".
public  URLgetURL()
    
public  inthashCode()
    
public  booleanisDirectory()
     Tests whether the named file is a directory, or not.
public  longlength()
     Returns the length of the named file if it is not a directory.
public  String[]list()
     Get the names of all files and sub-directories in the directory named by this path name. An array of the names of the files and directories in thisdirectory denoted by this abstract pathname.
public  booleanmkdir()
     Creates the named directory.
public  booleanmkdirs()
     Creates the named directory, and all nonexistent parent directories.
public  voidreleaseExclusiveFileLock()
    
public  booleanrenameTo(StorageFile newName)
     Rename the file denoted by this name.
public  booleansetReadOnly()
     Make the named file or directory read-only.
public  StringtoString()
     Get the file name for diagnostic purposes.

Field Detail
nameStart
final int nameStart(Code)



path
final String path(Code)



storageFactory
final BaseStorageFactory storageFactory(Code)




Constructor Detail
InputStreamFile
InputStreamFile(BaseStorageFactory storageFactory, String path)(Code)



InputStreamFile
InputStreamFile(BaseStorageFactory storageFactory, String parent, String name)(Code)



InputStreamFile
InputStreamFile(InputStreamFile dir, String name)(Code)



InputStreamFile
InputStreamFile(BaseStorageFactory storageFactory, String child, int pathLen)(Code)




Method Detail
canWrite
public boolean canWrite()(Code)
Determine whether the named file is writable. true if the file exists and is writable, false if not.



createNewFile
public boolean createNewFile() throws IOException(Code)
If the named file does not already exist then create it as an empty normal file. The implementation must synchronize with other threads accessing the same file (in the same or a different process). If two threads both attempt to create a file with the same name at the same time then at most one should succeed. true if this thread's invocation of createNewFile successfully created the named file;false if not, i.e. false if the named file already exists or if another concurrent thread created it.
exception:
  IOException - - If the directory does not exist or some other I/O error occurred



delete
public boolean delete()(Code)
Deletes the named file or empty directory. This method does not delete non-empty directories. true if the named file or directory is successfully deleted, false if not



deleteAll
public boolean deleteAll()(Code)
Deletes the named file and, if it is a directory, all the files and directories it contains. true if the named file or directory is successfully deleted, false if not



equals
public boolean equals(Object other)(Code)



exists
abstract public boolean exists()(Code)
Tests whether the named file exists. true if the named file exists, false if not.



getCanonicalPath
public String getCanonicalPath() throws IOException(Code)



getExclusiveFileLock
public int getExclusiveFileLock()(Code)
Get an exclusive lock with this name. This is used to ensure that two or more JVMs do not open the same database at the same time. EXCLUSIVE_FILE_LOCK_NOT_AVAILABLE if the lock cannot be acquired because it is already held.
EXCLUSIVE_FILE_LOCK if the lock was successfully acquired.
NO_FILE_LOCK_SUPPORT if the system does not support exclusive locks.



getInputStream
abstract public InputStream getInputStream() throws FileNotFoundException(Code)
Creates an input stream from a file name. an input stream suitable for reading from the file.
exception:
  FileNotFoundException - if the file is not found.



getName
public String getName()(Code)
The last segment in the path name, "" if the path name sequence is empty.



getOutputStream
public OutputStream getOutputStream() throws FileNotFoundException(Code)
Creates an output stream from a file name. If a normal file already exists with this name it will first be truncated to zero length. an output stream suitable for writing to the file.
exception:
  FileNotFoundException - if the file exists but is a directoryrather than a regular file, does not exist but cannot be created, orcannot be opened for any other reason.



getOutputStream
public OutputStream getOutputStream(boolean append) throws FileNotFoundException(Code)
Creates an output stream from a file name. If a normal file already exists with this name it will first be truncated to zero length. an output stream suitable for writing to the file.
exception:
  FileNotFoundException - if the file exists but is a directoryrather than a regular file, does not exist but cannot be created, orcannot be opened for any other reason.



getParentDir
public StorageFile getParentDir()(Code)
Get the name of the parent directory if this name includes a parent. An StorageFile denoting the parent directory of this StorageFile, if it has a parent, null ifit does not have a parent.



getParentDir
abstract StorageFile getParentDir(int pathLen)(Code)
Get the parent of this file.
Parameters:
  pathLen - the length of the parent's path name.



getPath
public String getPath()(Code)
Converts this StorageFile into a pathname string. The character returned by StorageFactory.getSeparator() is used to separate the directory and file names in the sequence.

The returned path may include the database directory. Therefore it cannot be directly used to make an StorageFile equivalent to this one. The pathname as a string.
See Also:   StorageFactory.getSeparator




getRandomAccessFile
public StorageRandomAccessFile getRandomAccessFile(String mode) throws FileNotFoundException(Code)
Get a random access file.
Parameters:
  mode - "r", "rw", "rws", or "rwd". The "rws" and "rwd" modes specifythat the data is to be written to persistent store, consistent with thejava.io.RandomAccessFile class ("synchronized" with the persistentstorage, in the file system meaning of the word "synchronized"). Howeverthe implementation is not required to implement the "rws" or "rwd"modes. The implementation may treat "rws" and "rwd" as "rw". It is up tothe user of this interface to call the StorageRandomAccessFile.syncmethod. However, if the "rws" or "rwd" modes are supported and theRandomAccessFile was opened in "rws" or "rwd" mode then theimplementation of StorageRandomAccessFile.sync need not do anything. an object that can be used for random access to the file.
exception:
  IllegalArgumentException - if the mode argument is not equal to one of "r", "rw", "rws", or "rwd".
exception:
  FileNotFoundException - if the file exists but is a directory rather than a regularfile, or cannot be opened or created for any other reason .
See Also:    java.io.RandomAccessFile



getURL
public URL getURL() throws MalformedURLException(Code)

See Also:   org.apache.derby.io.StorageFile.getURL



hashCode
public int hashCode()(Code)



isDirectory
public boolean isDirectory()(Code)
Tests whether the named file is a directory, or not. This is only called in writable storage factories. true if named file exists and is a directory, false if not.The return value is undefined if the storage is read-only.



length
public long length()(Code)
Returns the length of the named file if it is not a directory. The return value is not specified if the file is a directory. The length, in bytes, of the named file if it exists and is not a directory,0 if the file does not exist, or any value if the named file is a directory.



list
public String[] list()(Code)
Get the names of all files and sub-directories in the directory named by this path name. An array of the names of the files and directories in thisdirectory denoted by this abstract pathname. The returned array will have length 0if this directory is empty. Returns null if this StorageFile is not a directory, orif an I/O error occurs.



mkdir
public boolean mkdir()(Code)
Creates the named directory. true if the directory was created; false if not.



mkdirs
public boolean mkdirs()(Code)
Creates the named directory, and all nonexistent parent directories. true if the directory was created, false if not



releaseExclusiveFileLock
public void releaseExclusiveFileLock()(Code)
Release the resource associated with an earlier acquired exclusive lock
See Also:   InputStreamFile.getExclusiveFileLock



renameTo
public boolean renameTo(StorageFile newName)(Code)
Rename the file denoted by this name. Note that StorageFile objects are immutable. This method renames the underlying file, it does not change this StorageFile object. The StorageFile object denotes the same name as before, however the exists() method will return false after the renameTo method executes successfully.

It is not specified whether this method will succeed if a file already exists under the new name.
Parameters:
  newName - the new name. true if the rename succeeded, false if not.




setReadOnly
public boolean setReadOnly()(Code)
Make the named file or directory read-only. This interface does not specify whether this also makes the file undeletable. true if the named file or directory was made read-only, or it already was read-only;false if not.



toString
public String toString()(Code)
Get the file name for diagnostic purposes. Usually the same as getPath(). the file name



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.