001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.commons.vfs.impl;
018:
019: import java.net.URL;
020: import java.util.List;
021:
022: import org.apache.commons.vfs.FileContent;
023: import org.apache.commons.vfs.FileName;
024: import org.apache.commons.vfs.FileObject;
025: import org.apache.commons.vfs.FileSelector;
026: import org.apache.commons.vfs.FileSystem;
027: import org.apache.commons.vfs.FileSystemException;
028: import org.apache.commons.vfs.FileType;
029: import org.apache.commons.vfs.NameScope;
030: import org.apache.commons.vfs.operations.FileOperations;
031:
032: /**
033: * Base class to build a fileObject decoration
034: *
035: * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
036: * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
037: */
038: public class DecoratedFileObject implements FileObject {
039: final FileObject decoratedFileObject;
040:
041: public DecoratedFileObject(FileObject decoratedFileObject) {
042: super ();
043: this .decoratedFileObject = decoratedFileObject;
044: }
045:
046: public boolean canRenameTo(FileObject newfile) {
047: return decoratedFileObject.canRenameTo(newfile);
048: }
049:
050: public void close() throws FileSystemException {
051: decoratedFileObject.close();
052: }
053:
054: public void copyFrom(FileObject srcFile, FileSelector selector)
055: throws FileSystemException {
056: decoratedFileObject.copyFrom(srcFile, selector);
057: }
058:
059: public void createFile() throws FileSystemException {
060: decoratedFileObject.createFile();
061: }
062:
063: public void createFolder() throws FileSystemException {
064: decoratedFileObject.createFolder();
065: }
066:
067: public boolean delete() throws FileSystemException {
068: return decoratedFileObject.delete();
069: }
070:
071: public int delete(FileSelector selector) throws FileSystemException {
072: return decoratedFileObject.delete(selector);
073: }
074:
075: public boolean exists() throws FileSystemException {
076: return decoratedFileObject.exists();
077: }
078:
079: public void findFiles(FileSelector selector, boolean depthwise,
080: List selected) throws FileSystemException {
081: decoratedFileObject.findFiles(selector, depthwise, selected);
082: }
083:
084: public FileObject[] findFiles(FileSelector selector)
085: throws FileSystemException {
086: return decoratedFileObject.findFiles(selector);
087: }
088:
089: public FileObject getChild(String name) throws FileSystemException {
090: return decoratedFileObject.getChild(name);
091: }
092:
093: public FileObject[] getChildren() throws FileSystemException {
094: return decoratedFileObject.getChildren();
095: }
096:
097: public FileContent getContent() throws FileSystemException {
098: return decoratedFileObject.getContent();
099: }
100:
101: public FileSystem getFileSystem() {
102: return decoratedFileObject.getFileSystem();
103: }
104:
105: public FileName getName() {
106: return decoratedFileObject.getName();
107: }
108:
109: public FileObject getParent() throws FileSystemException {
110: return decoratedFileObject.getParent();
111: }
112:
113: public FileType getType() throws FileSystemException {
114: return decoratedFileObject.getType();
115: }
116:
117: public URL getURL() throws FileSystemException {
118: return decoratedFileObject.getURL();
119: }
120:
121: public boolean isHidden() throws FileSystemException {
122: return decoratedFileObject.isHidden();
123: }
124:
125: public boolean isReadable() throws FileSystemException {
126: return decoratedFileObject.isReadable();
127: }
128:
129: public boolean isWriteable() throws FileSystemException {
130: return decoratedFileObject.isWriteable();
131: }
132:
133: public void moveTo(FileObject destFile) throws FileSystemException {
134: decoratedFileObject.moveTo(destFile);
135: }
136:
137: public FileObject resolveFile(String name, NameScope scope)
138: throws FileSystemException {
139: return decoratedFileObject.resolveFile(name, scope);
140: }
141:
142: public FileObject resolveFile(String path)
143: throws FileSystemException {
144: return decoratedFileObject.resolveFile(path);
145: }
146:
147: public void refresh() throws FileSystemException {
148: decoratedFileObject.refresh();
149: }
150:
151: public FileObject getDecoratedFileObject() {
152: return decoratedFileObject;
153: }
154:
155: public boolean isAttached() {
156: return decoratedFileObject.isAttached();
157: }
158:
159: public boolean isContentOpen() {
160: return decoratedFileObject.isContentOpen();
161: }
162:
163: public String toString() {
164: return decoratedFileObject.toString();
165: }
166:
167: public FileOperations getFileOperations()
168: throws FileSystemException {
169: return decoratedFileObject.getFileOperations();
170: }
171: }
|