Java Doc for OpenFlags.java in  » Net » Ganymed-SSH-2 » ch » ethz » ssh2 » sftp » 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 » Net » Ganymed SSH 2 » ch.ethz.ssh2.sftp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   ch.ethz.ssh2.sftp.OpenFlags

OpenFlags
public class OpenFlags (Code)
SFTP Open Flags. The following table is provided to assist in mapping POSIX semantics to equivalent SFTP file open parameters:

TODO: This comment should be moved to the open method.

  • O_RDONLY
    • desired-access = READ_DATA | READ_ATTRIBUTES
  • O_WRONLY
    • desired-access = WRITE_DATA | WRITE_ATTRIBUTES
  • O_RDWR
    • desired-access = READ_DATA | READ_ATTRIBUTES | WRITE_DATA | WRITE_ATTRIBUTES
  • O_APPEND
    • desired-access = WRITE_DATA | WRITE_ATTRIBUTES | APPEND_DATA
    • flags = SSH_FXF_ACCESS_APPEND_DATA and or SSH_FXF_ACCESS_APPEND_DATA_ATOMIC
  • O_CREAT
    • flags = SSH_FXF_OPEN_OR_CREATE
  • O_TRUNC
    • flags = SSH_FXF_TRUNCATE_EXISTING
  • O_TRUNC|O_CREATE
    • flags = SSH_FXF_CREATE_TRUNCATE

author:
   Christian Plattner, plattner@inf.ethz.ch
version:
   $Id: OpenFlags.java,v 1.2 2006/08/02 12:05:00 cplattne Exp $


Field Summary
final public static  intSSH_FXF_ACCESS_APPEND_DATA
     Data is always written at the end of the file.
final public static  intSSH_FXF_ACCESS_APPEND_DATA_ATOMIC
     Data is always written at the end of the file.
final public static  intSSH_FXF_ACCESS_BLOCK_ADVISORY
     If this bit is set, the above BLOCK modes are advisory.
final public static  intSSH_FXF_ACCESS_BLOCK_DELETE
     The server MUST guarantee that no other handle has been opened with ACE4_DELETE access, opened with the SSH_FXF_ACCESS_DELETE_ON_CLOSE flag set, and that no other handle will be opened with ACE4_DELETE access or with the SSH_FXF_ACCESS_DELETE_ON_CLOSE flag set, and that the file itself is not deleted in any other way until the client closes the handle.

If there is a conflicting lock the server MUST return SSH_FX_LOCK_CONFLICT.

final public static  intSSH_FXF_ACCESS_BLOCK_READ
     The server MUST guarantee that no other handle has been opened with ACE4_READ_DATA access, and that no other handle will be opened with ACE4_READ_DATA access until the client closes the handle.
final public static  intSSH_FXF_ACCESS_BLOCK_WRITE
     The server MUST guarantee that no other handle has been opened with ACE4_WRITE_DATA or ACE4_APPEND_DATA access, and that no other handle will be opened with ACE4_WRITE_DATA or ACE4_APPEND_DATA access until the client closes the handle.
final public static  intSSH_FXF_ACCESS_DELETE_ON_CLOSE
     The file should be deleted when the last handle to it is closed.
final public static  intSSH_FXF_ACCESS_DISPOSITION
     Disposition is a 3 bit field that controls how the file is opened.
final public static  intSSH_FXF_ACCESS_NOFOLLOW
     If the final component of the path is a symlink, then the open MUST fail, and the error SSH_FX_LINK_LOOP MUST be returned.
final public static  intSSH_FXF_ACCESS_TEXT_MODE
     Indicates that the server should treat the file as text and convert it to the canonical newline convention in use. (See Determining Server Newline Convention in section 5.3 in the SFTP standard draft).

When a file is opened with this flag, the offset field in the read and write functions is ignored.

Servers MUST process multiple, parallel reads and writes correctly in this mode.

final public static  intSSH_FXF_CREATE_NEW
     A new file is created; if the file already exists, the server MUST return status SSH_FX_FILE_ALREADY_EXISTS.
final public static  intSSH_FXF_CREATE_TRUNCATE
     A new file is created; if the file already exists, it is opened and truncated.
final public static  intSSH_FXF_OPEN_EXISTING
     An existing file is opened.
final public static  intSSH_FXF_OPEN_OR_CREATE
     If the file exists, it is opened.
final public static  intSSH_FXF_TRUNCATE_EXISTING
     An existing file is opened and truncated.



Field Detail
SSH_FXF_ACCESS_APPEND_DATA
final public static int SSH_FXF_ACCESS_APPEND_DATA(Code)
Data is always written at the end of the file. The offset field of the SSH_FXP_WRITE requests are ignored.

Data is not required to be appended atomically. This means that if multiple writers attempt to append data simultaneously, data from the first may be lost. However, data MAY be appended atomically.




SSH_FXF_ACCESS_APPEND_DATA_ATOMIC
final public static int SSH_FXF_ACCESS_APPEND_DATA_ATOMIC(Code)
Data is always written at the end of the file. The offset field of the SSH_FXP_WRITE requests are ignored.

Data MUST be written atomically so that there is no chance that multiple appenders can collide and result in data being lost.

If both append flags are specified, the server SHOULD use atomic append if it is available, but SHOULD use non-atomic appends otherwise. The server SHOULD NOT fail the request in this case.




SSH_FXF_ACCESS_BLOCK_ADVISORY
final public static int SSH_FXF_ACCESS_BLOCK_ADVISORY(Code)
If this bit is set, the above BLOCK modes are advisory. In advisory mode, only other accesses that specify a BLOCK mode need be considered when determining whether the BLOCK can be granted, and the server need not prevent I/O operations that violate the block mode.

The server MAY perform mandatory locking even if the BLOCK_ADVISORY bit is set.




SSH_FXF_ACCESS_BLOCK_DELETE
final public static int SSH_FXF_ACCESS_BLOCK_DELETE(Code)
The server MUST guarantee that no other handle has been opened with ACE4_DELETE access, opened with the SSH_FXF_ACCESS_DELETE_ON_CLOSE flag set, and that no other handle will be opened with ACE4_DELETE access or with the SSH_FXF_ACCESS_DELETE_ON_CLOSE flag set, and that the file itself is not deleted in any other way until the client closes the handle.

If there is a conflicting lock the server MUST return SSH_FX_LOCK_CONFLICT. If the server cannot make the locking guarantee, it MUST return SSH_FX_OP_UNSUPPORTED.




SSH_FXF_ACCESS_BLOCK_READ
final public static int SSH_FXF_ACCESS_BLOCK_READ(Code)
The server MUST guarantee that no other handle has been opened with ACE4_READ_DATA access, and that no other handle will be opened with ACE4_READ_DATA access until the client closes the handle. (This MUST apply both to other clients and to other processes on the server.)

If there is a conflicting lock the server MUST return SSH_FX_LOCK_CONFLICT. If the server cannot make the locking guarantee, it MUST return SSH_FX_OP_UNSUPPORTED.

Other handles MAY be opened for ACE4_WRITE_DATA or any other combination of accesses, as long as ACE4_READ_DATA is not included in the mask.




SSH_FXF_ACCESS_BLOCK_WRITE
final public static int SSH_FXF_ACCESS_BLOCK_WRITE(Code)
The server MUST guarantee that no other handle has been opened with ACE4_WRITE_DATA or ACE4_APPEND_DATA access, and that no other handle will be opened with ACE4_WRITE_DATA or ACE4_APPEND_DATA access until the client closes the handle. (This MUST apply both to other clients and to other processes on the server.)

If there is a conflicting lock the server MUST return SSH_FX_LOCK_CONFLICT. If the server cannot make the locking guarantee, it MUST return SSH_FX_OP_UNSUPPORTED.

Other handles MAY be opened for ACE4_READ_DATA or any other combination of accesses, as long as neither ACE4_WRITE_DATA nor ACE4_APPEND_DATA are included in the mask.




SSH_FXF_ACCESS_DELETE_ON_CLOSE
final public static int SSH_FXF_ACCESS_DELETE_ON_CLOSE(Code)
The file should be deleted when the last handle to it is closed. (The last handle may not be an sftp-handle.) This MAY be emulated by a server if the OS doesn't support it by deleting the file when this handle is closed.

It is implementation specific whether the directory entry is removed immediately or when the handle is closed.




SSH_FXF_ACCESS_DISPOSITION
final public static int SSH_FXF_ACCESS_DISPOSITION(Code)
Disposition is a 3 bit field that controls how the file is opened. The server MUST support these bits (possible enumaration values: SSH_FXF_CREATE_NEW, SSH_FXF_CREATE_TRUNCATE, SSH_FXF_OPEN_EXISTING, SSH_FXF_OPEN_OR_CREATE or SSH_FXF_TRUNCATE_EXISTING).



SSH_FXF_ACCESS_NOFOLLOW
final public static int SSH_FXF_ACCESS_NOFOLLOW(Code)
If the final component of the path is a symlink, then the open MUST fail, and the error SSH_FX_LINK_LOOP MUST be returned.



SSH_FXF_ACCESS_TEXT_MODE
final public static int SSH_FXF_ACCESS_TEXT_MODE(Code)
Indicates that the server should treat the file as text and convert it to the canonical newline convention in use. (See Determining Server Newline Convention in section 5.3 in the SFTP standard draft).

When a file is opened with this flag, the offset field in the read and write functions is ignored.

Servers MUST process multiple, parallel reads and writes correctly in this mode. Naturally, it is permissible for them to do this by serializing the requests.

Clients SHOULD use the SSH_FXF_ACCESS_APPEND_DATA flag to append data to a text file rather then using write with a calculated offset.




SSH_FXF_CREATE_NEW
final public static int SSH_FXF_CREATE_NEW(Code)
A new file is created; if the file already exists, the server MUST return status SSH_FX_FILE_ALREADY_EXISTS.



SSH_FXF_CREATE_TRUNCATE
final public static int SSH_FXF_CREATE_TRUNCATE(Code)
A new file is created; if the file already exists, it is opened and truncated.



SSH_FXF_OPEN_EXISTING
final public static int SSH_FXF_OPEN_EXISTING(Code)
An existing file is opened. If the file does not exist, the server MUST return SSH_FX_NO_SUCH_FILE. If a directory in the path does not exist, the server SHOULD return SSH_FX_NO_SUCH_PATH. It is also acceptable if the server returns SSH_FX_NO_SUCH_FILE in this case.



SSH_FXF_OPEN_OR_CREATE
final public static int SSH_FXF_OPEN_OR_CREATE(Code)
If the file exists, it is opened. If the file does not exist, it is created.



SSH_FXF_TRUNCATE_EXISTING
final public static int SSH_FXF_TRUNCATE_EXISTING(Code)
An existing file is opened and truncated. If the file does not exist, the server MUST return the same error codes as defined for SSH_FXF_OPEN_EXISTING.





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.