use of org.pentaho.di.plugins.fileopensave.api.providers.exception.InvalidFileOperationException in project pentaho-kettle by pentaho.
the class RepositoryFileProvider method copy.
@Override
public RepositoryFile copy(RepositoryFile file, String toPath, boolean overwrite) throws FileException {
RepositoryElementInterface repositoryElementInterface = getObject(file.getObjectId(), file.getType());
if (repositoryElementInterface != null) {
repositoryElementInterface.setName(Util.getName(toPath));
repositoryElementInterface.setObjectId(null);
try {
getRepository().save(repositoryElementInterface, null, null);
} catch (KettleException e) {
}
} else {
throw new InvalidFileOperationException();
}
RepositoryFile repositoryFile = new RepositoryFile();
return repositoryFile;
}
Aggregations