1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs2.cache;
18
19 import java.util.List;
20
21 import org.apache.commons.vfs2.FileContent;
22 import org.apache.commons.vfs2.FileObject;
23 import org.apache.commons.vfs2.FileSelector;
24 import org.apache.commons.vfs2.FileSystemException;
25 import org.apache.commons.vfs2.FileType;
26 import org.apache.commons.vfs2.NameScope;
27 import org.apache.commons.vfs2.impl.DecoratedFileObject;
28
29
30
31
32 public class OnCallRefreshFileObject extends DecoratedFileObject {
33
34
35
36
37
38
39 public OnCallRefreshFileObject(final FileObject fileObject) {
40 super(fileObject);
41 }
42
43 @Override
44 public void close() throws FileSystemException {
45 refresh();
46 super.close();
47 }
48
49 @Override
50 public void copyFrom(final FileObject srcFile, final FileSelector selector) throws FileSystemException {
51 refresh();
52 super.copyFrom(srcFile, selector);
53 }
54
55 @Override
56 public void createFile() throws FileSystemException {
57 refresh();
58 super.createFile();
59 }
60
61 @Override
62 public void createFolder() throws FileSystemException {
63 refresh();
64 super.createFolder();
65 }
66
67 @Override
68 public boolean delete() throws FileSystemException {
69 refresh();
70 return super.delete();
71 }
72
73 @Override
74 public int delete(final FileSelector selector) throws FileSystemException {
75 refresh();
76 return super.delete(selector);
77 }
78
79 @Override
80 public boolean exists() throws FileSystemException {
81 refresh();
82 return super.exists();
83 }
84
85 @Override
86 public FileObject[] findFiles(final FileSelector selector) throws FileSystemException {
87 refresh();
88 return super.findFiles(selector);
89 }
90
91 @Override
92 public void findFiles(final FileSelector selector, final boolean depthwise, final List<FileObject> selected)
93 throws FileSystemException {
94 refresh();
95 super.findFiles(selector, depthwise, selected);
96 }
97
98 @Override
99 public FileObject getChild(final String name) throws FileSystemException {
100 refresh();
101 return super.getChild(name);
102 }
103
104 @Override
105 public FileObject[] getChildren() throws FileSystemException {
106 refresh();
107 return super.getChildren();
108 }
109
110 @Override
111 public FileContent getContent() throws FileSystemException {
112 refresh();
113 return super.getContent();
114 }
115
116 @Override
117 public FileType getType() throws FileSystemException {
118 refresh();
119 return super.getType();
120 }
121
122 @Override
123 public boolean isExecutable() throws FileSystemException {
124 refresh();
125 return super.isExecutable();
126 }
127
128 @Override
129 public boolean isHidden() throws FileSystemException {
130 refresh();
131 return super.isHidden();
132 }
133
134 @Override
135 public boolean isReadable() throws FileSystemException {
136 refresh();
137 return super.isReadable();
138 }
139
140 @Override
141 public boolean isWriteable() throws FileSystemException {
142 refresh();
143 return super.isWriteable();
144 }
145
146 @Override
147 public void moveTo(final FileObject destFile) throws FileSystemException {
148 refresh();
149 super.moveTo(destFile);
150 }
151
152 @Override
153 public FileObject resolveFile(final String path) throws FileSystemException {
154 refresh();
155 return super.resolveFile(path);
156 }
157
158 @Override
159 public FileObject resolveFile(final String name, final NameScope scope) throws FileSystemException {
160 refresh();
161 return super.resolveFile(name, scope);
162 }
163
164 @Override
165 public boolean setExecutable(final boolean executable, final boolean ownerOnly) throws FileSystemException {
166 refresh();
167 return super.setExecutable(executable, ownerOnly);
168 }
169
170 @Override
171 public boolean setReadable(final boolean readable, final boolean ownerOnly) throws FileSystemException {
172 refresh();
173 return super.setReadable(readable, ownerOnly);
174 }
175
176 @Override
177 public boolean setWritable(final boolean writable, final boolean ownerOnly) throws FileSystemException {
178 refresh();
179 return super.setWritable(writable, ownerOnly);
180 }
181 }