Revision 21a76038 src/gr/ebs/gss/server/webdav/milton/GssFileResource.java
b/src/gr/ebs/gss/server/webdav/milton/GssFileResource.java | ||
---|---|---|
117 | 117 |
@Override |
118 | 118 |
public Void call() throws Exception { |
119 | 119 |
if(newFsParent.folder.getId().equals(file.getFolder().getId())){ |
120 |
factory.getService().updateFile(getCurrentUser().getId(), file.getId(), arg1, null, new Date(), null, null, null);
|
|
120 |
getService().updateFile(getCurrentUser().getId(), file.getId(), arg1, null, new Date(), null, null, null); |
|
121 | 121 |
} |
122 | 122 |
else{ |
123 |
factory.getService().moveFile(getCurrentUser().getId(), file.getId(), newFsParent.folder.getId(), arg1);
|
|
123 |
getService().moveFile(getCurrentUser().getId(), file.getId(), newFsParent.folder.getId(), arg1); |
|
124 | 124 |
} |
125 | 125 |
return null; |
126 | 126 |
} |
127 | 127 |
|
128 | 128 |
}); |
129 |
GssFileResource.this.file = factory.getService().getFile(getCurrentUser().getId(), file.getId());
|
|
129 |
GssFileResource.this.file = getService().getFile(getCurrentUser().getId(), file.getId()); |
|
130 | 130 |
|
131 | 131 |
} catch (InsufficientPermissionsException e) { |
132 | 132 |
throw new NotAuthorizedException(this); |
... | ... | |
155 | 155 |
|
156 | 156 |
@Override |
157 | 157 |
public Void call() throws Exception { |
158 |
factory.getService().copyFile(getCurrentUser().getId(), file.getId(), newFsParent.folder.getId(), arg1);
|
|
158 |
getService().copyFile(getCurrentUser().getId(), file.getId(), newFsParent.folder.getId(), arg1); |
|
159 | 159 |
return null; |
160 | 160 |
} |
161 | 161 |
|
162 | 162 |
}); |
163 |
GssFileResource.this.file = factory.getService().getFile(getCurrentUser().getId(), file.getId());
|
|
163 |
GssFileResource.this.file = getService().getFile(getCurrentUser().getId(), file.getId()); |
|
164 | 164 |
} catch (InsufficientPermissionsException e) { |
165 | 165 |
throw new NotAuthorizedException(this); |
166 | 166 |
} catch (ObjectNotFoundException e) { |
... | ... | |
186 | 186 |
|
187 | 187 |
@Override |
188 | 188 |
public Void call() throws Exception { |
189 |
factory.getService().deleteFile(getCurrentUser().getId(), file.getId());
|
|
189 |
getService().deleteFile(getCurrentUser().getId(), file.getId()); |
|
190 | 190 |
return null; |
191 | 191 |
} |
192 | 192 |
}); |
... | ... | |
197 | 197 |
} catch (RpcException e) { |
198 | 198 |
throw new BadRequestException(this); |
199 | 199 |
} |
200 |
catch (Exception e) { |
|
201 |
e.printStackTrace(); |
|
200 |
catch (Exception e) { |
|
202 | 201 |
throw new BadRequestException(this); |
203 | 202 |
} |
204 | 203 |
} |
... | ... | |
218 | 217 |
public void sendContent(OutputStream out, Range range, Map<String, String> params, String contentType ) throws IOException { |
219 | 218 |
InputStream in = null; |
220 | 219 |
try { |
221 |
in = factory.getService().getFileContents(getCurrentUser().getId(), file.getId());
|
|
220 |
in = getService().getFileContents(getCurrentUser().getId(), file.getId()); |
|
222 | 221 |
if( range != null ) { |
223 | 222 |
copy(in, out, range); |
224 | 223 |
} else { |
... | ... | |
228 | 227 |
IOUtils.closeQuietly( in ); |
229 | 228 |
} catch (ObjectNotFoundException e) { |
230 | 229 |
// TODO Auto-generated catch block |
231 |
e.printStackTrace(); |
|
232 | 230 |
} catch (InsufficientPermissionsException e) { |
233 | 231 |
// TODO Auto-generated catch block |
234 |
e.printStackTrace(); |
|
235 | 232 |
} catch (RpcException e) { |
236 | 233 |
// TODO Auto-generated catch block |
237 |
e.printStackTrace(); |
|
238 | 234 |
} |
239 | 235 |
catch(ClientAbortException ex){ |
240 | 236 |
//do nothing |
241 | 237 |
} |
242 | 238 |
finally { |
243 | 239 |
IOUtils.closeQuietly( in ); |
240 |
IOUtils.closeQuietly( out ); |
|
244 | 241 |
} |
245 | 242 |
|
246 | 243 |
} |
... | ... | |
335 | 332 |
User user = getCurrentUser(); |
336 | 333 |
//check permission |
337 | 334 |
try { |
338 |
factory.getService().getFile(user.getId(), file.getId());
|
|
335 |
getService().getFile(user.getId(), file.getId()); |
|
339 | 336 |
} catch (ObjectNotFoundException e) { |
340 | 337 |
return false; |
341 | 338 |
} catch (InsufficientPermissionsException e) { |
Also available in: Unified diff