Source Code Cross Referenced for StaticRemoteFile.java in  » Net » DrFTPD » org » drftpd » remotefile » 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 » DrFTPD » org.drftpd.remotefile 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of DrFTPD, Distributed FTP Daemon.
003:         *
004:         * DrFTPD is free software; you can redistribute it and/or modify
005:         * it under the terms of the GNU General Public License as published by
006:         * the Free Software Foundation; either version 2 of the License, or
007:         * (at your option) any later version.
008:         *
009:         * DrFTPD is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:         * GNU General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU General Public License
015:         * along with DrFTPD; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */
018:        package org.drftpd.remotefile;
019:
020:        import java.util.Collection;
021:        import java.util.Collections;
022:        import java.util.List;
023:
024:        /**
025:         * Creates a single RemoteFile object that is not linked to any other objects.
026:         *
027:         * @author mog
028:         * @version $Id: StaticRemoteFile.java 1513 2006-10-13 22:41:08Z tdsoul $
029:         */
030:        public class StaticRemoteFile extends AbstractRemoteFile {
031:            private long _checkSum;
032:            private String _groupname;
033:            private long _lastModified;
034:            private long _length;
035:            private String _link = null;
036:            private String _name;
037:            private List _rslaves;
038:            private String _username;
039:            private long _xfertime;
040:
041:            public StaticRemoteFile(List rslaves, String name, long size) {
042:                this (rslaves, name, null, null, size, System
043:                        .currentTimeMillis());
044:            }
045:
046:            /**
047:             * @param _rslave
048:             * @param string
049:             * @param string2
050:             * @param string3
051:             * @param i
052:             */
053:            public StaticRemoteFile(List rslaves, String name, String user,
054:                    String group, int size) {
055:                this (rslaves, name, user, group, size, System
056:                        .currentTimeMillis());
057:            }
058:
059:            /**
060:             * @param rslaves null indicates that this is a directory.
061:             */
062:            public StaticRemoteFile(List rslaves, String name, String owner,
063:                    String group, long size, long lastModified) {
064:                _rslaves = rslaves;
065:                _name = name;
066:
067:                //		if(name.indexOf("/") != -1) {
068:                //			throw new IllegalArgumentException("constructor only does files and not paths");
069:                //		}
070:                _username = owner;
071:                _groupname = group;
072:                _length = size;
073:                _lastModified = lastModified;
074:            }
075:
076:            public StaticRemoteFile(List rslaves, String name, String owner,
077:                    String group, long size, long lastModified, long checkSum) {
078:                this (rslaves, name, owner, group, size, lastModified);
079:                _checkSum = checkSum;
080:            }
081:
082:            public StaticRemoteFile(String name) {
083:                _length = 0;
084:                _lastModified = System.currentTimeMillis();
085:                _name = name;
086:                if (_name.indexOf("\\") != -1) {
087:                    throw new RuntimeException(
088:                            "Cannot create a filename with \\ in the path");
089:                }
090:            }
091:
092:            public StaticRemoteFile(String name, List rslaves) {
093:                this (name);
094:                _rslaves = rslaves;
095:            }
096:
097:            public StaticRemoteFile(String name, List rslaves, String link) {
098:                this (name, rslaves);
099:                _link = link;
100:            }
101:
102:            public long getCheckSumCached() {
103:                return _checkSum;
104:            }
105:
106:            /**
107:             * StaticRemoteFile cannot be linked
108:             * @return java.util.Collections.EMPTY_LIST
109:             */
110:            public List getFiles() {
111:                return Collections.EMPTY_LIST;
112:            }
113:
114:            public String getGroupname() {
115:                return _groupname;
116:            }
117:
118:            public String getLinkPath() {
119:                return _link;
120:            }
121:
122:            public String getName() {
123:                return _name;
124:            }
125:
126:            public String getParent() {
127:                throw new UnsupportedOperationException(
128:                        "getParent() does not exist in StaticRemoteFile");
129:            }
130:
131:            public String getPath() {
132:                throw new UnsupportedOperationException();
133:            }
134:
135:            public Collection getSlaves() {
136:                return _rslaves;
137:            }
138:
139:            public String getUsername() {
140:                return _username;
141:            }
142:
143:            public long getXfertime() {
144:                return _xfertime;
145:            }
146:
147:            public boolean isDirectory() {
148:                return _rslaves == null;
149:            }
150:
151:            public boolean isFile() {
152:                return _rslaves != null;
153:            }
154:
155:            public boolean isLink() {
156:                return _link != null;
157:            }
158:
159:            public long lastModified() {
160:                return _lastModified;
161:            }
162:
163:            public long length() {
164:                return _length;
165:            }
166:
167:            /**
168:             * Sets the checkSum.
169:             * @param checkSum The checkSum to set
170:             */
171:            public void setCheckSum(long checkSum) {
172:                _checkSum = checkSum;
173:            }
174:
175:            public void setGroupname(String groupname) {
176:                _groupname = groupname;
177:            }
178:
179:            public void setLastModified(long lastmodified) {
180:                _lastModified = lastmodified;
181:            }
182:
183:            public void setLength(long length) {
184:                _length = length;
185:            }
186:
187:            public void setLink(String link) {
188:                _link = link;
189:            }
190:
191:            public void setRSlaves(List rslaves) {
192:                _rslaves = rslaves;
193:            }
194:
195:            public void setUsername(String username) {
196:                _username = username;
197:            }
198:
199:            public void setXfertime(long xfertime) {
200:                _xfertime = xfertime;
201:            }
202:
203:            public String toString() {
204:                StringBuffer ret = new StringBuffer();
205:                ret.append(getClass().getName() + "[");
206:
207:                if (isDirectory()) {
208:                    ret.append("[isDirectory(): true]");
209:                }
210:
211:                if (isFile()) {
212:                    ret.append("[isFile(): true]");
213:                }
214:
215:                ret.append("[length(): " + length() + "]");
216:                ret.append(getName());
217:                ret.append("]");
218:                ret.append("[rslaves:" + _rslaves + "]");
219:
220:                return ret.toString();
221:            }
222:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.