Source Code Cross Referenced for AbstractFile.java in  » Scripting » oscript-2.10.4 » oscript » fs » 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 » Scripting » oscript 2.10.4 » oscript.fs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*=============================================================================
002:         *     Copyright Texas Instruments 2000-2003.  All Rights Reserved.
003:         *   
004:         * This program is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         * 
009:         * This program is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         * 
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */
018:
019:        package oscript.fs;
020:
021:        /**
022:         * An interface to be implemented by something that can implement file-like
023:         * operations.  Ie read as a stream, write as a stream.
024:         * 
025:         * @author Rob Clark (rob@ti.com)
026:         */
027:        public interface AbstractFile {
028:            /**
029:             * Get an input stream to read from this file.
030:             * 
031:             * @return input stream
032:             * @throws IOException if <code>canRead</code> returns <code>true</code>
033:             * @see #canRead
034:             */
035:            public java.io.InputStream getInputStream()
036:                    throws java.io.IOException;
037:
038:            /**
039:             * Get an output stream to write to this file.
040:             * 
041:             * @return output stream
042:             * @throws IOException if <code>canWrite</code> returns <code>false</code>
043:             * @see #canWrite
044:             */
045:            public java.io.OutputStream getOutputStream(boolean append)
046:                    throws java.io.IOException;
047:
048:            /**
049:             * Return the time of last modification.  The meaning of these value is not
050:             * so important, but the implementation must ensure that a higher value is
051:             * returned for the more recent version of a given element.  Ie. if at some
052:             * point this returns X, an <code>AbstractFile</code> representing the same
053:             * "file", but created at a later time, should return X if the file has not
054:             * been modified, or >X if the file has been modified.
055:             * 
056:             * @return larger value indicates more recent modification
057:             */
058:            public long lastModified();
059:
060:            /**
061:             * Return the length of the file in bytes.
062:             */
063:            public long length();
064:
065:            /**
066:             * Is it possible to read from this file.
067:             */
068:            public boolean canRead();
069:
070:            /**
071:             * Is it possible to write to this file.
072:             */
073:            public boolean canWrite();
074:
075:            /**
076:             * Tests whether this file exists.
077:             *
078:             * @return  <code>true</code> iff the file exists
079:             */
080:            public boolean exists();
081:
082:            /**
083:             * Test whether this file is a directory.
084:             * 
085:             * @return <code>true</code> iff this file is a directory
086:             */
087:            public boolean isDirectory();
088:
089:            /**
090:             * Test whether this file is a regular file.  A file is a regular file if
091:             * it is not a directory.
092:             * 
093:             * @return <code>true</code> iff this file is a regular file.
094:             */
095:            public boolean isFile();
096:
097:            /**
098:             * Create a new empty file, if it does not yet exist.
099:             * 
100:             * @return <code>true</code> iff the file does not exist and was successfully
101:             * created.
102:             * @throws IOException if error
103:             */
104:            public boolean createNewFile() throws java.io.IOException;
105:
106:            /**
107:             * Update the timestamp on this file to the current time.
108:             * 
109:             * @throws IOException if error
110:             */
111:            public void touch() throws java.io.IOException;
112:
113:            /**
114:             * Delete this file.  If this file is a directory, then the directory must
115:             * be empty.
116:             * 
117:             * @return <code>true<code> iff the directory is successfully deleted.
118:             * @throws IOException if error
119:             */
120:            public boolean delete() throws java.io.IOException;
121:
122:            /**
123:             * If this file does not exist, create it as a directory.
124:             * 
125:             * @return <code>true</code> iff directory successfully created
126:             */
127:            public boolean mkdir() throws java.io.IOException;
128:
129:            /**
130:             * If this file does not exist, create it as a directory.  All necessary
131:             * parent directories are also created.  If this operation fails, it may
132:             * have successfully created some or all of the parent directories.
133:             * 
134:             * @return <code>true</code> iff directory successfully created
135:             */
136:            public boolean mkdirs() throws java.io.IOException;
137:
138:            /**
139:             * Get the file path, which globally identifies the file.
140:             * 
141:             * @return a unique string
142:             * @see #getName
143:             */
144:            public String getPath();
145:
146:            /**
147:             * Get the name of this file, which is the last component of the complete path.
148:             * 
149:             * @return the file name
150:             * @see #getPath
151:             */
152:            public String getName();
153:
154:            /**
155:             * Get the extension, which indicates the type of file.  Usually the extension
156:             * is part of the filename, ie. if the extension was <i>os</i>, the filename
157:             * would end with <i>.os</i>.
158:             * 
159:             * @return a string indicating the type of file
160:             */
161:            public String getExtension();
162:        }
163:
164:        /*
165:         *   Local Variables:
166:         *   tab-width: 2
167:         *   indent-tabs-mode: nil
168:         *   mode: java
169:         *   c-indentation-style: java
170:         *   c-basic-offset: 2
171:         *   eval: (c-set-offset 'substatement-open '0)
172:         *   eval: (c-set-offset 'case-label '+)
173:         *   eval: (c-set-offset 'inclass '+)
174:         *   eval: (c-set-offset 'inline-open '0)
175:         *   End:
176:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.