throws NotAuthorizedException, BadRequestException,
ConflictException {
FolderResource newParent = (FolderResource) to;
Resource existing = newParent.child(name);
if (existing != null)
throw new ConflictException();
try {
// avoid copying the data, just copy the ContentPointer
newParent.createNew(name, file.getContentPointer(), file
.getContentType());
} catch (IOException e) {
e.printStackTrace();
throw new ConflictException(this);
}
}