use of org.bimserver.database.actions.UploadFileDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method uploadFile.
@Override
public Long uploadFile(SFile file) throws ServerException, UserException {
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
File convertFromSObject = getBimServer().getSConverter().convertFromSObject(file, session.create(File.class), session);
UploadFileDatabaseAction action = new UploadFileDatabaseAction(session, getInternalAccessMethod(), convertFromSObject);
return session.executeAndCommitAction(action);
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations