Java Doc for File.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » tomcat » jni » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.tomcat.jni 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tomcat.jni.File

File
public class File (Code)
File
author:
   Mladen Turk
version:
   $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $


Field Summary
final public static  intAPR_BLK
    
final public static  intAPR_CHR
    
final public static  intAPR_CUR
    
final public static  intAPR_DIR
    
final public static  intAPR_END
    
final public static  intAPR_FILE_ATTR_EXECUTABLE
    
final public static  intAPR_FILE_ATTR_HIDDEN
    
final public static  intAPR_FILE_ATTR_READONLY
    
final public static  intAPR_FINFO_ATIME
    
final public static  intAPR_FINFO_CSIZE
    
final public static  intAPR_FINFO_CTIME
    
final public static  intAPR_FINFO_DEV
    
final public static  intAPR_FINFO_DIRENT
    
final public static  intAPR_FINFO_GPROT
    
final public static  intAPR_FINFO_GROUP
    
final public static  intAPR_FINFO_ICASE
    
final public static  intAPR_FINFO_IDENT
    
final public static  intAPR_FINFO_INODE
    
final public static  intAPR_FINFO_LINK
    
final public static  intAPR_FINFO_MIN
    
final public static  intAPR_FINFO_MTIME
    
final public static  intAPR_FINFO_NAME
    
final public static  intAPR_FINFO_NLINK
    
final public static  intAPR_FINFO_NORM
    
final public static  intAPR_FINFO_OWNER
    
final public static  intAPR_FINFO_PROT
    
final public static  intAPR_FINFO_SIZE
    
final public static  intAPR_FINFO_TYPE
    
final public static  intAPR_FINFO_UPROT
    
final public static  intAPR_FINFO_USER
    
final public static  intAPR_FINFO_WPROT
    
final public static  intAPR_FLOCK_EXCLUSIVE
     Exclusive lock.
final public static  intAPR_FLOCK_NONBLOCK
    
final public static  intAPR_FLOCK_SHARED
     Shared lock.
final public static  intAPR_FLOCK_TYPEMASK
    
final public static  intAPR_FOPEN_APPEND
    
final public static  intAPR_FOPEN_BINARY
    
final public static  intAPR_FOPEN_BUFFERED
    
final public static  intAPR_FOPEN_CREATE
    
final public static  intAPR_FOPEN_DELONCLOSE
    
final public static  intAPR_FOPEN_EXCL
     Open should fail if APR_CREATE and file exists.
final public static  intAPR_FOPEN_LARGEFILE
     Platform dependent flag to enable large file support;
Warning : The APR_LARGEFILE flag only has effect on some platforms where sizeof(apr_off_t) == 4.
final public static  intAPR_FOPEN_NOCLEANUP
    
final public static  intAPR_FOPEN_READ
    
final public static  intAPR_FOPEN_SENDFILE_ENABLED
    
final public static  intAPR_FOPEN_SHARELOCK
    
final public static  intAPR_FOPEN_TRUNCATE
    
final public static  intAPR_FOPEN_WRITE
    
final public static  intAPR_FOPEN_XTHREAD
    
final public static  intAPR_FPROT_GEXECUTE
    
final public static  intAPR_FPROT_GREAD
    
final public static  intAPR_FPROT_GSETID
    
final public static  intAPR_FPROT_GWRITE
    
final public static  intAPR_FPROT_OS_DEFAULT
    
final public static  intAPR_FPROT_UEXECUTE
    
final public static  intAPR_FPROT_UREAD
    
final public static  intAPR_FPROT_USETID
    
final public static  intAPR_FPROT_UWRITE
    
final public static  intAPR_FPROT_WEXECUTE
    
final public static  intAPR_FPROT_WREAD
    
final public static  intAPR_FPROT_WSTICKY
    
final public static  intAPR_FPROT_WWRITE
    
final public static  intAPR_LNK
    
final public static  intAPR_NOFILE
    
final public static  intAPR_PIPE
    
final public static  intAPR_REG
    
final public static  intAPR_SET
    
final public static  intAPR_SOCK
    
final public static  intAPR_UNKFILE
    


Method Summary
native public static  intappend(String fromPath, String toPath, int perms, long pool)
     Append the specified file to another file.
native public static  intattrsSet(String fname, int attributes, int mask, long pool)
     Set attributes of the specified file.
native public static  intclose(long file)
     Close the specified file.
native public static  intcopy(String fromPath, String toPath, int perms, long pool)
     Copy the specified file to another file.
native public static  longdup(long newFile, long oldFile, long pool)
     Duplicate the specified file descriptor.
Parameters:
  newFile - The file to duplicate.newFile must point to a valid apr_file_t, or point to NULL.
Parameters:
  oldFile - The file to duplicate.
Parameters:
  pool - The pool to use for the new file.
native public static  intdup2(long newFile, long oldFile, long pool)
     Duplicate the specified file descriptor and close the original.
Parameters:
  newFile - The old file that is to be closed and reused.newFile MUST point at a valid apr_file_t.
native public static  inteof(long fptr)
     Are we at the end of the file
Parameters:
  fptr - The apr file we are testing.
native public static  intflagsGet(long file)
     Retrieve the flags that were passed into apr_file_open() when the file was opened.
Parameters:
  file - The file to retrive flags.
native public static  intflush(long thefile)
     Flush the file's buffer.
native public static  intgetc(long thefile)
     Read a character from the specified file.
native public static  intgets(byte[] buf, int offset, long thefile)
     Read a string from the specified file.
native public static  intinfoGet(FileInfo finfo, int wanted, long thefile)
     Get the specified file's stats.
native public static  intlock(long thefile, int type)
     Establish a lock on the specified, open file.
native public static  longmktemp(String templ, int flags, long pool)
     Open a temporary file
Parameters:
  templ - The template to use when creating a temp file.
Parameters:
  flags - The flags to open the file with.
native public static  intmtimeSet(String fname, long mtime, long pool)
     Set the mtime of the specified file.
native public static  StringnameGet(long thefile)
     return the file name of the current file.
native public static  longopen(String fname, int flag, int perm, long pool)
     Open the specified file.
Parameters:
  fname - The full path to the file (using / on all systems)
Parameters:
  flag - Or'ed value of:
APR_FOPEN_READ              open for readingAPR_FOPEN_WRITE             open for writingAPR_FOPEN_CREATE            create the file if not thereAPR_FOPEN_APPEND            file ptr is set to end prior to all writesAPR_FOPEN_TRUNCATE          set length to zero if file existsAPR_FOPEN_BINARY            not a text file (This flag is ignored onUNIX because it has no meaning)APR_FOPEN_BUFFERED          buffer the data.
native public static  intpermsSet(String fname, int perms)
     Set the specified file's permission bits.
native public static  intpipeCreate(long[] io, long pool)
     Create an anonymous pipe.
native public static  longpipeTimeoutGet(long thepipe)
     Get the timeout value for a pipe or manipulate the blocking state.
Parameters:
  thepipe - The pipe we are getting a timeout for.
native public static  intpipeTimeoutSet(long thepipe, long timeout)
     Set the timeout value for a pipe or manipulate the blocking state.
Parameters:
  thepipe - The pipe we are setting a timeout on.
Parameters:
  timeout - The timeout value in microseconds.
native public static  intputc(byte ch, long thefile)
     Write a character into the specified file.
native public static  intputs(byte[] str, long thefile)
     Write the string into the specified file.
Parameters:
  str - The string to write.
native public static  intread(long thefile, byte[] buf, int offset, int nbytes)
     Read data from the specified file. apr_file_read will read up to the specified number of bytes, but never more.
native public static  intreadFull(long thefile, byte[] buf, int offset, int nbytes)
     Read data from the specified file, ensuring that the buffer is filled before returning. Read will read up to the specified number of bytes, but never more.
native public static  intreadFullb(long thefile, ByteBuffer buf, int offset, int nbytes)
     Read data from the specified file, ensuring that the buffer is filled before returning. Read will read up to the specified number of bytes, but never more.
native public static  intreadb(long thefile, ByteBuffer buf, int offset, int nbytes)
     Read data from the specified file. apr_file_read will read up to the specified number of bytes, but never more.
native public static  intremove(String path, long pool)
     Delete the specified file.
native public static  intrename(String fromPath, String toPath, long pool)
     Rename the specified file.
Warning : If a file exists at the new location, then it will be overwritten.
native public static  longseek(long thefile, int where, long offset)
     Move the read/write file offset to a specified byte within a file.
Parameters:
  thefile - The file descriptor
Parameters:
  where - How to move the pointer, one of:
APR_SET  --  set the offset to offsetAPR_CUR  --  add the offset to the current positionAPR_END  --  add the offset to the current file size

Parameters:
  offset - The offset to move the pointer to.
native public static  intstat(FileInfo finfo, String fname, int wanted, long pool)
     Get the specified file's stats.
native public static  inttrunc(long fp, long offset)
    
native public static  intungetc(byte ch, long thefile)
     Put a character back onto a specified stream.
native public static  intunlock(long thefile)
     Remove any outstanding locks on the file.
native public static  intwrite(long thefile, byte[] buf, int offset, int nbytes)
     Write data to the specified file. Write will write up to the specified number of bytes, but never more.
native public static  intwriteFull(long thefile, byte[] buf, int offset, int nbytes)
     Write data to the specified file, ensuring that all of the data is written before returning. Write will write up to the specified number of bytes, but never more.
native public static  intwriteFullb(long thefile, ByteBuffer buf, int offset, int nbytes)
     Write data to the specified file, ensuring that all of the data is written before returning. Write will write up to the specified number of bytes, but never more.
native public static  intwriteb(long thefile, ByteBuffer buf, int offset, int nbytes)
     Write data to the specified file. Write will write up to the specified number of bytes, but never more.
native public static  intwritev(long thefile, byte[][] vec)
     Write data from aray of byte arrays to the specified file. It is possible for both bytes to be written and an error to be returned.
native public static  intwritevFull(long thefile, byte[][] vec)
     Write data from aray of byte arrays to the specified file, ensuring that all of the data is written before returning. writevFull is available even if the underlying operating system doesn't provide writev().
Parameters:
  thefile - The file descriptor to write to.
Parameters:
  vec - The array from which to get the data to write to the file.

Field Detail
APR_BLK
final public static int APR_BLK(Code)
a block device



APR_CHR
final public static int APR_CHR(Code)
a character device



APR_CUR
final public static int APR_CUR(Code)
Current



APR_DIR
final public static int APR_DIR(Code)
a directory



APR_END
final public static int APR_END(Code)
Go to end of file



APR_FILE_ATTR_EXECUTABLE
final public static int APR_FILE_ATTR_EXECUTABLE(Code)
File is executable



APR_FILE_ATTR_HIDDEN
final public static int APR_FILE_ATTR_HIDDEN(Code)
File is hidden



APR_FILE_ATTR_READONLY
final public static int APR_FILE_ATTR_READONLY(Code)
File is read-only



APR_FINFO_ATIME
final public static int APR_FINFO_ATIME(Code)
Creation or inode-changed time



APR_FINFO_CSIZE
final public static int APR_FINFO_CSIZE(Code)
Size of the file



APR_FINFO_CTIME
final public static int APR_FINFO_CTIME(Code)
Modification Time



APR_FINFO_DEV
final public static int APR_FINFO_DEV(Code)
Storage size consumed by the file



APR_FINFO_DIRENT
final public static int APR_FINFO_DIRENT(Code)
an atomic unix apr_stat()



APR_FINFO_GPROT
final public static int APR_FINFO_GPROT(Code)
User protection bits



APR_FINFO_GROUP
final public static int APR_FINFO_GROUP(Code)
User



APR_FINFO_ICASE
final public static int APR_FINFO_ICASE(Code)
World protection bits



APR_FINFO_IDENT
final public static int APR_FINFO_IDENT(Code)
type, mtime, ctime, atime, size



APR_FINFO_INODE
final public static int APR_FINFO_INODE(Code)
Device



APR_FINFO_LINK
final public static int APR_FINFO_LINK(Code)
use OS's default permissions



APR_FINFO_MIN
final public static int APR_FINFO_MIN(Code)
->name in proper case



APR_FINFO_MTIME
final public static int APR_FINFO_MTIME(Code)
Stat the link not the file itself if it is a link



APR_FINFO_NAME
final public static int APR_FINFO_NAME(Code)
if dev is case insensitive



APR_FINFO_NLINK
final public static int APR_FINFO_NLINK(Code)
Inode



APR_FINFO_NORM
final public static int APR_FINFO_NORM(Code)
all protections



APR_FINFO_OWNER
final public static int APR_FINFO_OWNER(Code)
dev and inode



APR_FINFO_PROT
final public static int APR_FINFO_PROT(Code)
user and group



APR_FINFO_SIZE
final public static int APR_FINFO_SIZE(Code)
Access Time



APR_FINFO_TYPE
final public static int APR_FINFO_TYPE(Code)
Number of links



APR_FINFO_UPROT
final public static int APR_FINFO_UPROT(Code)
Group



APR_FINFO_USER
final public static int APR_FINFO_USER(Code)
Type



APR_FINFO_WPROT
final public static int APR_FINFO_WPROT(Code)
Group protection bits



APR_FLOCK_EXCLUSIVE
final public static int APR_FLOCK_EXCLUSIVE(Code)
Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".



APR_FLOCK_NONBLOCK
final public static int APR_FLOCK_NONBLOCK(Code)
do not block while acquiring the file lock



APR_FLOCK_SHARED
final public static int APR_FLOCK_SHARED(Code)
Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.



APR_FLOCK_TYPEMASK
final public static int APR_FLOCK_TYPEMASK(Code)
mask to extract lock type



APR_FOPEN_APPEND
final public static int APR_FOPEN_APPEND(Code)
Append to the end of the file



APR_FOPEN_BINARY
final public static int APR_FOPEN_BINARY(Code)
Open the file in binary mode



APR_FOPEN_BUFFERED
final public static int APR_FOPEN_BUFFERED(Code)
Open the file for buffered I/O



APR_FOPEN_CREATE
final public static int APR_FOPEN_CREATE(Code)
Create the file if not there



APR_FOPEN_DELONCLOSE
final public static int APR_FOPEN_DELONCLOSE(Code)
Delete the file after close



APR_FOPEN_EXCL
final public static int APR_FOPEN_EXCL(Code)
Open should fail if APR_CREATE and file exists.



APR_FOPEN_LARGEFILE
final public static int APR_FOPEN_LARGEFILE(Code)
Platform dependent flag to enable large file support;
Warning : The APR_LARGEFILE flag only has effect on some platforms where sizeof(apr_off_t) == 4. Where implemented, it allows opening and writing to a file which exceeds the size which can be represented by apr_off_t (2 gigabytes). When a file's size does exceed 2Gb, apr_file_info_get() will fail with an error on the descriptor, likewise apr_stat()/apr_lstat() will fail on the filename. apr_dir_read() will fail with APR_INCOMPLETE on a directory entry for a large file depending on the particular APR_FINFO_* flags. Generally, it is not recommended to use this flag.



APR_FOPEN_NOCLEANUP
final public static int APR_FOPEN_NOCLEANUP(Code)
Do not register a cleanup when the file is opened



APR_FOPEN_READ
final public static int APR_FOPEN_READ(Code)
Open the file for reading



APR_FOPEN_SENDFILE_ENABLED
final public static int APR_FOPEN_SENDFILE_ENABLED(Code)
Advisory flag that this file should support apr_socket_sendfile operation



APR_FOPEN_SHARELOCK
final public static int APR_FOPEN_SHARELOCK(Code)
Platform dependent support for higher level locked read/write access to support writes across process/machines



APR_FOPEN_TRUNCATE
final public static int APR_FOPEN_TRUNCATE(Code)
Open the file and truncate to 0 length



APR_FOPEN_WRITE
final public static int APR_FOPEN_WRITE(Code)
Open the file for writing



APR_FOPEN_XTHREAD
final public static int APR_FOPEN_XTHREAD(Code)
Platform dependent tag to open the file for use across multiple threads



APR_FPROT_GEXECUTE
final public static int APR_FPROT_GEXECUTE(Code)
Write by group



APR_FPROT_GREAD
final public static int APR_FPROT_GREAD(Code)
Set group id



APR_FPROT_GSETID
final public static int APR_FPROT_GSETID(Code)
Execute by user



APR_FPROT_GWRITE
final public static int APR_FPROT_GWRITE(Code)
Read by group



APR_FPROT_OS_DEFAULT
final public static int APR_FPROT_OS_DEFAULT(Code)
Execute by others



APR_FPROT_UEXECUTE
final public static int APR_FPROT_UEXECUTE(Code)
Write by user



APR_FPROT_UREAD
final public static int APR_FPROT_UREAD(Code)
Set user id



APR_FPROT_USETID
final public static int APR_FPROT_USETID(Code)



APR_FPROT_UWRITE
final public static int APR_FPROT_UWRITE(Code)
Read by user



APR_FPROT_WEXECUTE
final public static int APR_FPROT_WEXECUTE(Code)
Write by others



APR_FPROT_WREAD
final public static int APR_FPROT_WREAD(Code)
Sticky bit



APR_FPROT_WSTICKY
final public static int APR_FPROT_WSTICKY(Code)
Execute by group



APR_FPROT_WWRITE
final public static int APR_FPROT_WWRITE(Code)
Read by others



APR_LNK
final public static int APR_LNK(Code)
a symbolic link



APR_NOFILE
final public static int APR_NOFILE(Code)
no file type determined



APR_PIPE
final public static int APR_PIPE(Code)
a FIFO / pipe



APR_REG
final public static int APR_REG(Code)
a regular file



APR_SET
final public static int APR_SET(Code)
Set the file position



APR_SOCK
final public static int APR_SOCK(Code)
a [unix domain] socket



APR_UNKFILE
final public static int APR_UNKFILE(Code)
a file of some other unknown type





Method Detail
append
native public static int append(String fromPath, String toPath, int perms, long pool)(Code)
Append the specified file to another file. The new file does not need to exist, it will be created if required.
Parameters:
  fromPath - The full path to the source file (use / on all systems)
Parameters:
  toPath - The full path to the destination file (use / on all systems)
Parameters:
  perms - Access permissions for the destination file if it is created.In place of the usual or'd combination of file permissions, thevalue APR_FILE_SOURCE_PERMS may be given, in which case the sourcefile's permissions are copied.
Parameters:
  pool - The pool to use.



attrsSet
native public static int attrsSet(String fname, int attributes, int mask, long pool)(Code)
Set attributes of the specified file. This function should be used in preference to explict manipulation of the file permissions, because the operations to provide these attributes are platform specific and may involve more than simply setting permission bits.
Warning : Platforms which do not implement this feature will return APR_ENOTIMPL.
Parameters:
  fname - The full path to the file (using / on all systems)
Parameters:
  attributes - Or'd combination of
APR_FILE_ATTR_READONLY   - make the file readonlyAPR_FILE_ATTR_EXECUTABLE - make the file executableAPR_FILE_ATTR_HIDDEN     - make the file hidden

Parameters:
  mask - Mask of valid bits in attributes.
Parameters:
  pool - the pool to use.



close
native public static int close(long file)(Code)
Close the specified file.
Parameters:
  file - The file descriptor to close.



copy
native public static int copy(String fromPath, String toPath, int perms, long pool)(Code)
Copy the specified file to another file. The new file does not need to exist, it will be created if required.
Warning : If the new file already exists, its contents will be overwritten.
Parameters:
  fromPath - The full path to the original file (using / on all systems)
Parameters:
  toPath - The full path to the new file (using / on all systems)
Parameters:
  perms - Access permissions for the new file if it is created.In place of the usual or'd combination of file permissions, thevalue APR_FILE_SOURCE_PERMS may be given, in which case the sourcefile's permissions are copied.
Parameters:
  pool - The pool to use.



dup
native public static long dup(long newFile, long oldFile, long pool) throws Error(Code)
Duplicate the specified file descriptor.
Parameters:
  newFile - The file to duplicate.newFile must point to a valid apr_file_t, or point to NULL.
Parameters:
  oldFile - The file to duplicate.
Parameters:
  pool - The pool to use for the new file. Duplicated file structure.



dup2
native public static int dup2(long newFile, long oldFile, long pool)(Code)
Duplicate the specified file descriptor and close the original.
Parameters:
  newFile - The old file that is to be closed and reused.newFile MUST point at a valid apr_file_t. It cannot be NULL.
Parameters:
  oldFile - The file to duplicate.
Parameters:
  pool - The pool to use for the new file. Status code.



eof
native public static int eof(long fptr)(Code)
Are we at the end of the file
Parameters:
  fptr - The apr file we are testing. Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise.



flagsGet
native public static int flagsGet(long file)(Code)
Retrieve the flags that were passed into apr_file_open() when the file was opened.
Parameters:
  file - The file to retrive flags. the flags



flush
native public static int flush(long thefile)(Code)
Flush the file's buffer.
Parameters:
  thefile - The file descriptor to flush



getc
native public static int getc(long thefile) throws Error(Code)
Read a character from the specified file.
Parameters:
  thefile - The file descriptor to read from The readed character



gets
native public static int gets(byte[] buf, int offset, long thefile)(Code)
Read a string from the specified file. The buffer will be NUL-terminated if any characters are stored.
Parameters:
  buf - The buffer to store the string in.
Parameters:
  offset - Start offset in buf
Parameters:
  thefile - The file descriptor to read from



infoGet
native public static int infoGet(FileInfo finfo, int wanted, long thefile)(Code)
Get the specified file's stats.
Parameters:
  finfo - Where to store the information about the file.
Parameters:
  wanted - The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
Parameters:
  thefile - The file to get information about.



lock
native public static int lock(long thefile, int type)(Code)
Establish a lock on the specified, open file. The lock may be advisory or mandatory, at the discretion of the platform. The lock applies to the file as a whole, rather than a specific range. Locks are established on a per-thread/process basis; a second lock by the same thread will not block.
Parameters:
  thefile - The file to lock.
Parameters:
  type - The type of lock to establish on the file.



mktemp
native public static long mktemp(String templ, int flags, long pool) throws Error(Code)
Open a temporary file
Parameters:
  templ - The template to use when creating a temp file.
Parameters:
  flags - The flags to open the file with. If this is zero,the file is opened withAPR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_DELONCLOSE
Parameters:
  pool - The pool to allocate the file out of. The apr file to use as a temporary file.This function generates a unique temporary file name from template.The last six characters of template must be XXXXXX and these are replacedwith a string that makes the filename unique. Since it will be modified,template must not be a string constant, but should be declared as a characterarray.



mtimeSet
native public static int mtimeSet(String fname, long mtime, long pool)(Code)
Set the mtime of the specified file.
Warning : Platforms which do not implement this feature will return APR_ENOTIMPL.
Parameters:
  fname - The full path to the file (using / on all systems)
Parameters:
  mtime - The mtime to apply to the file in microseconds
Parameters:
  pool - The pool to use.



nameGet
native public static String nameGet(long thefile)(Code)
return the file name of the current file.
Parameters:
  thefile - The currently open file.



open
native public static long open(String fname, int flag, int perm, long pool) throws Error(Code)
Open the specified file.
Parameters:
  fname - The full path to the file (using / on all systems)
Parameters:
  flag - Or'ed value of:
APR_FOPEN_READ              open for readingAPR_FOPEN_WRITE             open for writingAPR_FOPEN_CREATE            create the file if not thereAPR_FOPEN_APPEND            file ptr is set to end prior to all writesAPR_FOPEN_TRUNCATE          set length to zero if file existsAPR_FOPEN_BINARY            not a text file (This flag is ignored onUNIX because it has no meaning)APR_FOPEN_BUFFERED          buffer the data.  Default is non-bufferedAPR_FOPEN_EXCL              return error if APR_CREATE and file existsAPR_FOPEN_DELONCLOSE        delete the file after closing.APR_FOPEN_XTHREAD           Platform dependent tag to open the filefor use across multiple threadsAPR_FOPEN_SHARELOCK         Platform dependent support for higherlevel locked read/write access to supportwrites across process/machinesAPR_FOPEN_NOCLEANUP         Do not register a cleanup with the poolpassed in on the pool argument (see below).The apr_os_file_t handle in apr_file_t will notbe closed when the pool is destroyed.APR_FOPEN_SENDFILE_ENABLED  Open with appropriate platform semanticsfor sendfile operations.  Advisory only,apr_socket_sendfile does not check this flag.

Parameters:
  perm - Access permissions for file.
Parameters:
  pool - The pool to use.If perm is APR_OS_DEFAULT and the file is being created,appropriate default permissions will be used. The opened file descriptor.



permsSet
native public static int permsSet(String fname, int perms)(Code)
Set the specified file's permission bits.
Warning : Some platforms may not be able to apply all of the available permission bits; APR_INCOMPLETE will be returned if some permissions are specified which could not be set.
Warning : Platforms which do not implement this feature will return APR_ENOTIMPL.
Parameters:
  fname - The file (name) to apply the permissions to.
Parameters:
  perms - The permission bits to apply to the file.



pipeCreate
native public static int pipeCreate(long[] io, long pool)(Code)
Create an anonymous pipe.
Parameters:
  io - io[0] The file descriptors to use as input to the pipe.io[1] The file descriptor to use as output from the pipe.
Parameters:
  pool - The pool to operate on.



pipeTimeoutGet
native public static long pipeTimeoutGet(long thepipe) throws Error(Code)
Get the timeout value for a pipe or manipulate the blocking state.
Parameters:
  thepipe - The pipe we are getting a timeout for. The current timeout value in microseconds.



pipeTimeoutSet
native public static int pipeTimeoutSet(long thepipe, long timeout)(Code)
Set the timeout value for a pipe or manipulate the blocking state.
Parameters:
  thepipe - The pipe we are setting a timeout on.
Parameters:
  timeout - The timeout value in microseconds. Values < 0 mean waitforever, 0 means do not wait at all.



putc
native public static int putc(byte ch, long thefile)(Code)
Write a character into the specified file.
Parameters:
  ch - The character to write.
Parameters:
  thefile - The file descriptor to write to



puts
native public static int puts(byte[] str, long thefile)(Code)
Write the string into the specified file.
Parameters:
  str - The string to write. Must be NUL terminated!
Parameters:
  thefile - The file descriptor to write to



read
native public static int read(long thefile, byte[] buf, int offset, int nbytes)(Code)
Read data from the specified file. apr_file_read will read up to the specified number of bytes, but never more. If there isn't enough data to fill that number of bytes, all of the available data is read. The third argument is modified to reflect the number of bytes read. If a char was put back into the stream via ungetc, it will be the first character returned. It is not possible for both bytes to be read and an APR_EOF or other error to be returned. APR_EINTR is never returned.
Parameters:
  thefile - The file descriptor to read from.
Parameters:
  buf - The buffer to store the data to.
Parameters:
  offset - Start offset in buf
Parameters:
  nbytes - The number of bytes to read (-1) for full array. the number of bytes read.



readFull
native public static int readFull(long thefile, byte[] buf, int offset, int nbytes)(Code)
Read data from the specified file, ensuring that the buffer is filled before returning. Read will read up to the specified number of bytes, but never more. If there isn't enough data to fill that number of bytes, then the process/thread will block until it is available or EOF is reached. If a char was put back into the stream via ungetc, it will be the first character returned. It is possible for both bytes to be read and an error to be returned. And if *bytes_read is less than nbytes, an accompanying error is _always_ returned. APR_EINTR is never returned.
Parameters:
  thefile - The file descriptor to read from.
Parameters:
  buf - The buffer to store the data to.
Parameters:
  offset - Start offset in buf
Parameters:
  nbytes - The number of bytes to read (-1) for full array. the number of bytes read.



readFullb
native public static int readFullb(long thefile, ByteBuffer buf, int offset, int nbytes)(Code)
Read data from the specified file, ensuring that the buffer is filled before returning. Read will read up to the specified number of bytes, but never more. If there isn't enough data to fill that number of bytes, then the process/thread will block until it is available or EOF is reached. If a char was put back into the stream via ungetc, it will be the first character returned. It is possible for both bytes to be read and an error to be returned. And if *bytes_read is less than nbytes, an accompanying error is _always_ returned. APR_EINTR is never returned.
Parameters:
  thefile - The file descriptor to read from.
Parameters:
  buf - The direct ByteBuffer to store the data to.
Parameters:
  offset - Start offset in buf
Parameters:
  nbytes - The number of bytes to read. the number of bytes read.



readb
native public static int readb(long thefile, ByteBuffer buf, int offset, int nbytes)(Code)
Read data from the specified file. apr_file_read will read up to the specified number of bytes, but never more. If there isn't enough data to fill that number of bytes, all of the available data is read. The third argument is modified to reflect the number of bytes read. If a char was put back into the stream via ungetc, it will be the first character returned. It is not possible for both bytes to be read and an APR_EOF or other error to be returned. APR_EINTR is never returned.
Parameters:
  thefile - The file descriptor to read from.
Parameters:
  buf - The direct Byte buffer to store the data to.
Parameters:
  offset - Start offset in buf
Parameters:
  nbytes - The number of bytes to read. the number of bytes read.



remove
native public static int remove(String path, long pool)(Code)
Delete the specified file.
Parameters:
  path - The full path to the file (using / on all systems)
Parameters:
  pool - The pool to use.If the file is open, it won't be removed until allinstances are closed.



rename
native public static int rename(String fromPath, String toPath, long pool)(Code)
Rename the specified file.
Warning : If a file exists at the new location, then it will be overwritten. Moving files or directories across devices may not be possible.
Parameters:
  fromPath - The full path to the original file (using / on all systems)
Parameters:
  toPath - The full path to the new file (using / on all systems)
Parameters:
  pool - The pool to use.



seek
native public static long seek(long thefile, int where, long offset) throws Error(Code)
Move the read/write file offset to a specified byte within a file.
Parameters:
  thefile - The file descriptor
Parameters:
  where - How to move the pointer, one of:
APR_SET  --  set the offset to offsetAPR_CUR  --  add the offset to the current positionAPR_END  --  add the offset to the current file size

Parameters:
  offset - The offset to move the pointer to. Offset the pointer was actually moved to.



stat
native public static int stat(FileInfo finfo, String fname, int wanted, long pool)(Code)
Get the specified file's stats. The file is specified by filename, instead of using a pre-opened file.
Parameters:
  finfo - Where to store the information about the file, which isnever touched if the call fails.
Parameters:
  fname - The name of the file to stat.
Parameters:
  wanted - The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
Parameters:
  pool - the pool to use to allocate the new file.



trunc
native public static int trunc(long fp, long offset)(Code)
Truncate the file's length to the specified offset
Parameters:
  fp - The file to truncate
Parameters:
  offset - The offset to truncate to.



ungetc
native public static int ungetc(byte ch, long thefile)(Code)
Put a character back onto a specified stream.
Parameters:
  ch - The character to write.
Parameters:
  thefile - The file descriptor to write to



unlock
native public static int unlock(long thefile)(Code)
Remove any outstanding locks on the file.
Parameters:
  thefile - The file to unlock.



write
native public static int write(long thefile, byte[] buf, int offset, int nbytes)(Code)
Write data to the specified file. Write will write up to the specified number of bytes, but never more. If the OS cannot write that many bytes, it will write as many as it can. The third argument is modified to reflect the * number of bytes written. It is possible for both bytes to be written and an error to be returned. APR_EINTR is never returned.
Parameters:
  thefile - The file descriptor to write to.
Parameters:
  buf - The buffer which contains the data.
Parameters:
  offset - Start offset in buf
Parameters:
  nbytes - The number of bytes to write; (-1) for full array. The number of bytes written.



writeFull
native public static int writeFull(long thefile, byte[] buf, int offset, int nbytes)(Code)
Write data to the specified file, ensuring that all of the data is written before returning. Write will write up to the specified number of bytes, but never more. If the OS cannot write that many bytes, the process/thread will block until they can be written. Exceptional error such as "out of space" or "pipe closed" will terminate with an error. It is possible for both bytes to be written and an error to be returned. And if *bytes_written is less than nbytes, an accompanying error is _always_ returned. APR_EINTR is never returned.
Parameters:
  thefile - The file descriptor to write to.
Parameters:
  buf - The buffer which contains the data.
Parameters:
  offset - Start offset in buf
Parameters:
  nbytes - The number of bytes to write; (-1) for full array. The number of bytes written.



writeFullb
native public static int writeFullb(long thefile, ByteBuffer buf, int offset, int nbytes)(Code)
Write data to the specified file, ensuring that all of the data is written before returning. Write will write up to the specified number of bytes, but never more. If the OS cannot write that many bytes, the process/thread will block until they can be written. Exceptional error such as "out of space" or "pipe closed" will terminate with an error. It is possible for both bytes to be written and an error to be returned. And if *bytes_written is less than nbytes, an accompanying error is _always_ returned. APR_EINTR is never returned.
Parameters:
  thefile - The file descriptor to write to.
Parameters:
  buf - The direct ByteBuffer which contains the data.
Parameters:
  offset - Start offset in buf
Parameters:
  nbytes - The number of bytes to write. The number of bytes written.



writeb
native public static int writeb(long thefile, ByteBuffer buf, int offset, int nbytes)(Code)
Write data to the specified file. Write will write up to the specified number of bytes, but never more. If the OS cannot write that many bytes, it will write as many as it can. The third argument is modified to reflect the * number of bytes written. It is possible for both bytes to be written and an error to be returned. APR_EINTR is never returned.
Parameters:
  thefile - The file descriptor to write to.
Parameters:
  buf - The direct Byte buffer which contains the data.
Parameters:
  offset - Start offset in buf
Parameters:
  nbytes - The number of bytes to write The number of bytes written.



writev
native public static int writev(long thefile, byte[][] vec)(Code)
Write data from aray of byte arrays to the specified file. It is possible for both bytes to be written and an error to be returned. APR_EINTR is never returned. apr_file_writev is available even if the underlying operating system doesn't provide writev().
Parameters:
  thefile - The file descriptor to write to.
Parameters:
  vec - The array from which to get the data to write to the file. The number of bytes written.



writevFull
native public static int writevFull(long thefile, byte[][] vec)(Code)
Write data from aray of byte arrays to the specified file, ensuring that all of the data is written before returning. writevFull is available even if the underlying operating system doesn't provide writev().
Parameters:
  thefile - The file descriptor to write to.
Parameters:
  vec - The array from which to get the data to write to the file. The number of bytes written.



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.