1 29 30 package com.caucho.vfs; 31 32 public class FileStatus { 33 private static long S_IFMT = 00170000; 34 private static long S_IFSOCK = 0140000; 35 private static long S_IFLNK = 0120000; 36 private static long S_IFREG = 0100000; 37 private static long S_IFBLK = 0060000; 38 private static long S_IFDIR = 0040000; 39 private static long S_IFCHR = 0020000; 40 private static long S_IFIFO = 0010000; 41 42 private long _st_dev; 43 private long _st_ino; 44 private int _st_mode; 45 private int _st_nlink; 46 private int _st_uid; 47 private int _st_gid; 48 private long _st_rdev; 49 private long _st_size; 50 private long _st_blksize; 51 private long _st_blocks; 52 private long _st_atime; 53 private long _st_mtime; 54 private long _st_ctime; 55 56 private boolean _isRegularFile; 57 private boolean _isDirectory; 58 private boolean _isCharacterDevice; 59 private boolean _isBlockDevice; 60 private boolean _isFIFO; 61 private boolean _isLink; 62 private boolean _isSocket; 63 64 public FileStatus(long st_dev, long st_ino, int st_mode, int st_nlink, 65 int st_uid, int st_gid, long st_rdev, long st_size, 66 long st_blksize, long st_blocks, 67 long st_atime, long st_mtime, long st_ctime, 68 boolean isRegularFile, boolean isDirectory, 69 boolean isCharacterDevice, boolean isBlockDevice, 70 boolean isFIFO, boolean isLink, boolean isSocket) 71 { 72 _st_dev = st_dev; 73 _st_ino = st_ino; 74 _st_mode = st_mode; 75 _st_nlink = st_nlink; 76 _st_uid = st_uid; 77 _st_gid = st_gid; 78 _st_rdev = st_rdev; 79 _st_size = st_size; 80 _st_blksize = st_blksize; 81 _st_blocks = st_blocks; 82 _st_atime = st_atime; 83 _st_mtime = st_mtime; 84 _st_ctime = st_ctime; 85 86 _isRegularFile = isRegularFile; 87 _isDirectory = isDirectory; 88 _isCharacterDevice = isCharacterDevice; 89 _isBlockDevice = isBlockDevice; 90 _isFIFO = isFIFO; 91 _isLink = isLink; 92 _isSocket = isSocket; 93 } 94 95 public long getDev() 96 { 97 return _st_dev; 98 } 99 100 public long getIno() 101 { 102 return _st_ino; 103 } 104 105 public int getMode() 106 { 107 return _st_mode; 108 } 109 110 public int getNlink() 111 { 112 return _st_nlink; 113 } 114 115 public int getUid() 116 { 117 return _st_uid; 118 } 119 120 public int getGid() 121 { 122 return _st_gid; 123 } 124 125 public long getRdev() 126 { 127 return _st_rdev; 128 } 129 130 public long getSize() 131 { 132 return _st_size; 133 } 134 135 public long getBlksize() 136 { 137 return _st_blksize; 138 } 139 140 public long getBlocks() 141 { 142 return _st_blocks; 143 } 144 145 public long getAtime() 146 { 147 return _st_atime; 148 } 149 150 public long getMtime() 151 { 152 return _st_mtime; 153 } 154 155 public long getCtime() 156 { 157 return _st_ctime; 158 } 159 160 public boolean isRegularFile() 161 { 162 return _isRegularFile; 163 } 164 165 public boolean isDirectory() 166 { 167 return _isDirectory; 168 } 169 170 public boolean isCharacterDevice() 171 { 172 return _isCharacterDevice; 173 } 174 175 public boolean isBlockDevice() 176 { 177 return _isBlockDevice; 178 } 179 180 public boolean isFIFO() 181 { 182 return _isFIFO; 183 } 184 185 public boolean isLink() 186 { 187 return _isLink; 188 } 189 190 public boolean isSocket() 191 { 192 return _isSocket; 193 } 194 } 195 | Popular Tags |