KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > vfs > FileStatus


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Emil Ong
28  */

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