KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > vfs > VFSFileLock


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.vfs;
21
22 /**
23  *
24  */

25 public final class VFSFileLock implements Comparable JavaDoc<VFSFileLock> {
26     
27     private final String JavaDoc fileName;
28     private final String JavaDoc fileURI;
29     private final boolean active;
30     private final String JavaDoc handle;
31     
32     /**
33      * Constructor
34      * @param fileName
35      * @param fileURI
36      * @param active
37      * @param handle
38      */

39     public VFSFileLock(String JavaDoc fileName, String JavaDoc fileURI, boolean active, String JavaDoc handle) {
40         this.fileName = fileName;
41         this.fileURI = fileURI;
42         this.active = active;
43         this.handle = handle;
44     }
45     
46     /**
47      * @return fileName
48      */

49     public String JavaDoc getFileName() {
50         return fileName;
51     }
52     
53     /**
54      * @return fileURI
55      */

56     public String JavaDoc getFileURI() {
57         return fileURI;
58     }
59
60     /**
61      * @return isActive
62      */

63     public boolean isActive() {
64         return active;
65     }
66
67     /**
68      * @return handle
69      */

70     public String JavaDoc getHandle() {
71         return handle;
72     }
73
74     /* (non-Javadoc)
75      * @see java.lang.Comparable#compareTo(java.lang.Object)
76      */

77     public int compareTo(VFSFileLock o) {
78         return getFileName().compareTo(o.getFileName());
79     }
80
81     @Override JavaDoc
82     public String JavaDoc toString() {
83         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
84         buffer.append("['");
85         buffer.append("fileName=").append(getFileName()).append("', ");
86         buffer.append("fileURI=").append(getFileURI()).append("', ");
87         buffer.append("active='").append(isActive()).append("', ");
88         buffer.append("handle='").append(getHandle()).append("'");
89         buffer.append("]");
90         return buffer.toString();
91     }
92 }
Popular Tags