@Override
public Path touch(final Path file, final TransferStatus status) throws BackgroundException {
try {
if(nodeid.isEncrypted(file)) {
nodeid.setFileKey(status);
}
final StatusOutputStream<VersionId> out = writer.write(file, status, new DisabledConnectionCallback());
out.close();
return new Path(file.getParent(), file.getName(), file.getType(),
new PathAttributes(file.attributes()).withVersionId(out.getStatus().id));
}
catch(IOException e) {
throw new DefaultIOExceptionMappingService().map("Cannot create file {0}", e, file);
}
}