public DLFileEntry addFile( String processUUID, String title, String description, File file, String[] tags) throws PortalException, SystemException { DLFileEntry fileEntry = null; try { fileEntry = fileService.addFileEntry( currentUser.getUserId(), processBaseGroup.getGroupId(), getFolder(processUUID).getFolderId(), file.getName(), title, description, null, null, file, new ServiceContext()); } catch (DuplicateFileException ex) { // fileEnrty = fileService.updateFileEntry(currentUser.getUserId(), // folder.getFolderId(), // "PASSPORT.pdf", // "Паспорт", // "Это паспорт", // null, // new File("C:\\Users\\mgubaidullin\\Desktop\\docs\\PASSPORT.pdf"), // new ServiceContext()); } // fileService.updateTagsAsset(currentUser.getUserId(), // fileEnrty, // new java.lang.String[]{"PROCESSBASE"}, // tags); return fileEntry; }
public DLFileEntry addFile( String processUUID, String title, String description, String fileName, byte[] body, String[] tags) throws PortalException, SystemException { DLFileEntry fileEntry = null; try { fileEntry = fileService.addFileEntry( currentUser.getUserId(), processBaseGroup.getGroupId(), getFolder(processUUID).getFolderId(), fileName, title, description, null, null, body, new ServiceContext()); } catch (DuplicateFileException ex) { } return fileEntry; }
public DLFileEntry updateFileEntry(DLFileEntry file) { try { return fileService.updateDLFileEntry(file); } catch (SystemException ex) { ex.printStackTrace(); return file; } }
public DLFileEntry getFileEntry(long fileId) { try { return fileService.getDLFileEntry(fileId); } catch (PortalException ex) { ex.printStackTrace(); return null; } catch (SystemException ex) { ex.printStackTrace(); return null; } }
public DLFileEntry getFileEntry(String processUUID, String title) { try { return fileService.getFileEntryByTitle( processBaseGroup.getGroupId(), getFolder(processUUID).getFolderId(), title); } catch (PortalException ex) { ex.printStackTrace(); return null; } catch (SystemException ex) { ex.printStackTrace(); return null; } }
public byte[] getFileBody(String processUUID, long fileId) { byte[] result = null; try { DLFileEntry file = getFileEntry(fileId); result = new byte[Long.valueOf(file.getSize()).intValue()]; InputStream is = fileService.getFileAsStream( currentUser.getCompanyId(), currentUser.getUserId(), processBaseGroup.getGroupId(), getFolder(processUUID).getFolderId(), file.getName()); is.read(result); } catch (PortalException ex) { ex.printStackTrace(); } catch (SystemException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } return result; }
public void deleteFile(long fileId) throws SystemException, PortalException { fileService.deleteDLFileEntry(fileId); }
public List<DLFileEntry> getProcessFiles(String processUUID) throws SystemException { return fileService.getFileEntries( processBaseGroup.getGroupId(), getFolder(processUUID).getFolderId()); }