001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.ftp.client;
020:
021: import javax.swing.Icon;
022:
023: import org.openharmonise.commons.xml.namespace.NamespaceType;
024: import org.openharmonise.vfs.*;
025: import org.openharmonise.vfs.gui.*;
026: import org.openharmonise.vfs.metadata.*;
027:
028: /**
029: * @author Matthew Large
030: *
031: */
032: public class FTPFileSystemView implements VirtualFileSystemView {
033:
034: /**
035: *
036: */
037: public FTPFileSystemView() {
038: super ();
039: }
040:
041: /* (non-Javadoc)
042: * @see com.simulacramedia.vfs.VirtualFileSystemView#getIcon(com.simulacramedia.vfs.VirtualFile)
043: */
044: public Icon getIcon(VirtualFile vfFile) {
045: if (vfFile.isDirectory()) {
046: return IconManager.getInstance().getIcon(
047: "16-dir-closed.gif");
048: } else {
049: return IconManager.getInstance().getIcon(
050: "16-plain-document.gif");
051: }
052: }
053:
054: /* (non-Javadoc)
055: * @see com.simulacramedia.vfs.VirtualFileSystemView#getIcon(com.simulacramedia.vfs.VirtualFile, boolean)
056: */
057: public Icon getIcon(VirtualFile vfFile, boolean bIsDirectoryOpen) {
058: if (bIsDirectoryOpen) {
059: return IconManager.getInstance().getIcon(
060: "16-dir-opened.gif");
061: } else {
062: return IconManager.getInstance().getIcon(
063: "16-dir-closed.gif");
064: }
065: }
066:
067: /* (non-Javadoc)
068: * @see com.simulacramedia.vfs.VirtualFileSystemView#getDisplayName(com.simulacramedia.vfs.VirtualFile)
069: */
070: public String getDisplayName(VirtualFile vfFile) {
071: return vfFile.getFileName();
072: }
073:
074: /* (non-Javadoc)
075: * @see com.simulacramedia.vfs.VirtualFileSystemView#getFileSystemIcon()
076: */
077: public Icon getFileSystemIcon() {
078: return null;
079: }
080:
081: /* (non-Javadoc)
082: * @see com.simulacramedia.vfs.VirtualFileSystemView#getFileSystemDisplayName()
083: */
084: public String getFileSystemDisplayName() {
085: return null;
086: }
087:
088: /* (non-Javadoc)
089: * @see com.simulacramedia.vfs.VirtualFileSystemView#getVFSIndependantProperty(java.lang.String)
090: */
091: public PropertyInstance getVFSIndependantProperty(
092: String sIndependantPropName) {
093: return null;
094: }
095:
096: /* (non-Javadoc)
097: * @see com.simulacramedia.vfs.VirtualFileSystemView#getModificationDate(com.simulacramedia.vfs.VirtualFile)
098: */
099: public String getModificationDate(VirtualFile vfFile) {
100: return (String) vfFile.getProperty(NamespaceType.OHRM.getURI(),
101: "modificationdate").getValues().get(0);
102: }
103:
104: /* (non-Javadoc)
105: * @see com.simulacramedia.vfs.VirtualFileSystemView#getContentType(com.simulacramedia.vfs.VirtualFile)
106: */
107: public String getContentType(VirtualFile vfFile) {
108: return null;
109: }
110:
111: /* (non-Javadoc)
112: * @see com.simulacramedia.vfs.VirtualFileSystemView#setContentType(com.simulacramedia.vfs.VirtualFile, java.lang.String)
113: */
114: public void setContentType(VirtualFile vfFile, String sContentType) {
115: }
116:
117: /* (non-Javadoc)
118: * @see com.simulacramedia.vfs.VirtualFileSystemView#getSummary(com.simulacramedia.vfs.VirtualFile)
119: */
120: public String getSummary(VirtualFile vfFile) {
121: return null;
122: }
123:
124: /* (non-Javadoc)
125: * @see com.simulacramedia.vfs.VirtualFileSystemView#getLogicalFileName(com.simulacramedia.vfs.VirtualFile)
126: */
127: public String getLogicalFileName(VirtualFile vfFile) {
128: return null;
129: }
130:
131: /* (non-Javadoc)
132: * @see com.simulacramedia.vfs.VirtualFileSystemView#getPublicationDate(com.simulacramedia.vfs.VirtualFile)
133: */
134: public String getPublicationDate(VirtualFile vfFile) {
135: return "none";
136: }
137:
138: /* (non-Javadoc)
139: * @see com.simulacramedia.vfs.VirtualFileSystemView#getArchiveDate(com.simulacramedia.vfs.VirtualFile)
140: */
141: public String getArchiveDate(VirtualFile vfFile) {
142: return "none";
143: }
144:
145: }
|