1 17 18 package org.apache.tomcat.jni; 19 20 import java.nio.ByteBuffer ; 21 26 27 public class File { 28 29 30 public static final int APR_FOPEN_READ = 0x00001; 31 32 public static final int APR_FOPEN_WRITE = 0x00002; 33 34 public static final int APR_FOPEN_CREATE = 0x00004; 35 36 public static final int APR_FOPEN_APPEND = 0x00008; 37 38 public static final int APR_FOPEN_TRUNCATE = 0x00010; 39 40 public static final int APR_FOPEN_BINARY = 0x00020; 41 42 public static final int APR_FOPEN_EXCL = 0x00040; 43 44 public static final int APR_FOPEN_BUFFERED = 0x00080; 45 46 public static final int APR_FOPEN_DELONCLOSE = 0x00100; 47 50 public static final int APR_FOPEN_XTHREAD = 0x00200; 51 54 public static final int APR_FOPEN_SHARELOCK = 0x00400; 55 56 public static final int APR_FOPEN_NOCLEANUP = 0x00800; 57 60 public static final int APR_FOPEN_SENDFILE_ENABLED = 0x01000; 61 73 public static final int APR_FOPEN_LARGEFILE = 0x04000; 74 75 76 public static final int APR_SET = 0; 77 78 public static final int APR_CUR = 1; 79 80 public static final int APR_END = 2; 81 82 83 84 85 public static final int APR_FILE_ATTR_READONLY = 0x01; 86 87 public static final int APR_FILE_ATTR_EXECUTABLE = 0x02; 88 89 public static final int APR_FILE_ATTR_HIDDEN = 0x04; 90 91 92 93 94 98 public static final int APR_FLOCK_SHARED = 1; 99 100 103 public static final int APR_FLOCK_EXCLUSIVE = 2; 104 105 public static final int APR_FLOCK_TYPEMASK = 0x000F; 106 107 public static final int APR_FLOCK_NONBLOCK = 0x0010; 108 109 119 120 121 public static final int APR_NOFILE = 0; 122 123 public static final int APR_REG = 1; 124 125 public static final int APR_DIR = 2; 126 127 public static final int APR_CHR = 3; 128 129 public static final int APR_BLK = 4; 130 131 public static final int APR_PIPE = 5; 132 133 public static final int APR_LNK = 6; 134 135 public static final int APR_SOCK = 7; 136 137 public static final int APR_UNKFILE = 127; 138 139 140 143 144 public static final int APR_FPROT_USETID = 0x8000; 145 public static final int APR_FPROT_UREAD = 0x0400; 146 public static final int APR_FPROT_UWRITE = 0x0200; 147 public static final int APR_FPROT_UEXECUTE = 0x0100; 148 149 public static final int APR_FPROT_GSETID = 0x4000; 150 public static final int APR_FPROT_GREAD = 0x0040; 151 public static final int APR_FPROT_GWRITE = 0x0020; 152 public static final int APR_FPROT_GEXECUTE = 0x0010; 153 154 public static final int APR_FPROT_WSTICKY = 0x2000; 155 public static final int APR_FPROT_WREAD = 0x0004; 156 public static final int APR_FPROT_WWRITE = 0x0002; 157 public static final int APR_FPROT_WEXECUTE = 0x0001; 158 public static final int APR_FPROT_OS_DEFAULT = 0x0FFF; 159 160 161 public static final int APR_FINFO_LINK = 0x00000001; 162 public static final int APR_FINFO_MTIME = 0x00000010; 163 public static final int APR_FINFO_CTIME = 0x00000020; 164 public static final int APR_FINFO_ATIME = 0x00000040; 165 public static final int APR_FINFO_SIZE = 0x00000100; 166 public static final int APR_FINFO_CSIZE = 0x00000200; 167 public static final int APR_FINFO_DEV = 0x00001000; 168 public static final int APR_FINFO_INODE = 0x00002000; 169 public static final int APR_FINFO_NLINK = 0x00004000; 170 public static final int APR_FINFO_TYPE = 0x00008000; 171 public static final int APR_FINFO_USER = 0x00010000; 172 public static final int APR_FINFO_GROUP = 0x00020000; 173 public static final int APR_FINFO_UPROT = 0x00100000; 174 public static final int APR_FINFO_GPROT = 0x00200000; 175 public static final int APR_FINFO_WPROT = 0x00400000; 176 public static final int APR_FINFO_ICASE = 0x01000000; 177 public static final int APR_FINFO_NAME = 0x02000000; 178 179 public static final int APR_FINFO_MIN = 0x00008170; 180 public static final int APR_FINFO_IDENT = 0x00003000; 181 public static final int APR_FINFO_OWNER = 0x00030000; 182 public static final int APR_FINFO_PROT = 0x00700000; 183 public static final int APR_FINFO_NORM = 0x0073b170; 184 public static final int APR_FINFO_DIRENT = 0x02000000; 185 186 187 188 222 public static native long open(String fname, int flag, int perm, long pool) 223 throws Error ; 224 225 229 public static native int close(long file); 230 231 235 public static native int flush(long thefile); 236 237 253 public static native long mktemp(String templ, int flags, long pool) 254 throws Error ; 255 256 263 public static native int remove(String path, long pool); 264 265 274 public static native int rename(String fromPath, String toPath, long pool); 275 276 288 public static native int copy(String fromPath, String toPath, int perms, long pool); 289 290 301 public static native int append(String fromPath, String toPath, int perms, long pool); 302 303 308 public static native int puts(byte [] str, long thefile); 309 310 322 public static native long seek(long thefile, int where, long offset) 323 throws Error ; 324 325 330 public static native int putc(byte ch, long thefile); 331 332 337 public static native int ungetc(byte ch, long thefile); 338 339 355 public static native int write(long thefile, byte[] buf, int offset, int nbytes); 356 357 373 public static native int writeb(long thefile, ByteBuffer buf, int offset, int nbytes); 374 375 396 public static native int writeFull(long thefile, byte[] buf, int offset, int nbytes); 397 398 419 public static native int writeFullb(long thefile, ByteBuffer buf, int offset, int nbytes); 420 421 433 public static native int writev(long thefile, byte[][] vec); 434 435 445 public static native int writevFull(long thefile, byte[][] vec); 446 447 465 public static native int read(long thefile, byte[] buf, int offset, int nbytes); 466 467 485 public static native int readb(long thefile, ByteBuffer buf, int offset, int nbytes); 486 487 508 public static native int readFull(long thefile, byte[] buf, int offset, int nbytes); 509 510 531 public static native int readFullb(long thefile, ByteBuffer buf, int offset, int nbytes); 532 533 540 public static native int gets(byte[] buf, int offset, long thefile); 541 542 543 548 public static native int getc(long thefile) 549 throws Error ; 550 551 556 public static native int eof(long fptr); 557 558 562 public static native String nameGet(long thefile); 563 564 575 public static native int permsSet(String fname, int perms); 576 577 595 public static native int attrsSet(String fname, int attributes, int mask, long pool); 596 597 605 public static native int mtimeSet(String fname, long mtime, long pool); 606 607 616 public static native int lock(long thefile, int type); 617 618 622 public static native int unlock(long thefile); 623 624 630 public static native int flagsGet(long file); 631 632 637 public static native int trunc(long fp, long offset); 638 639 645 public static native int pipeCreate(long [] io, long pool); 646 647 652 public static native long pipeTimeoutGet(long thepipe) 653 throws Error ; 654 655 661 public static native int pipeTimeoutSet(long thepipe, long timeout); 662 663 671 public static native long dup(long newFile, long oldFile, long pool) 672 throws Error ; 673 674 682 public static native int dup2(long newFile, long oldFile, long pool); 683 684 693 public static native int stat(FileInfo finfo, String fname, int wanted, long pool); 694 695 701 public static native int infoGet(FileInfo finfo, int wanted, long thefile); 702 703 } 704 | Popular Tags |