Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@124884 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
627c4df36e
commit
82ad0ae43e
|
@ -43,8 +43,6 @@ public class FilesStorage {
|
|||
private static final String STATISTICAL_ALGORITHM_PROJECT_FILE_DESCRIPTION = "Statistical Algorithm Project File";
|
||||
private static final String STATISTICAL_ALGORITHM_PROJECT_FILE_NAME = "stat_algo.project";
|
||||
|
||||
|
||||
|
||||
public static final Logger logger = LoggerFactory
|
||||
.getLogger(FilesStorage.class);
|
||||
|
||||
|
@ -94,8 +92,8 @@ public class FilesStorage {
|
|||
* Folder id
|
||||
* @throws StatAlgoImporterServiceException
|
||||
*/
|
||||
public WorkspaceItem copyItemOnFolder(String user, String itemId, String folderId)
|
||||
throws StatAlgoImporterServiceException {
|
||||
public WorkspaceItem copyItemOnFolder(String user, String itemId,
|
||||
String folderId) throws StatAlgoImporterServiceException {
|
||||
Workspace ws;
|
||||
try {
|
||||
ws = HomeLibrary.getUserWorkspace(user);
|
||||
|
@ -106,7 +104,7 @@ public class FilesStorage {
|
|||
"Destination is not a folder!");
|
||||
}
|
||||
|
||||
WorkspaceItem item=ws.copy(itemId, folderId);
|
||||
WorkspaceItem item = ws.copy(itemId, folderId);
|
||||
|
||||
return item;
|
||||
} catch (WrongDestinationException | ItemAlreadyExistException
|
||||
|
@ -146,7 +144,6 @@ public class FilesStorage {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param user
|
||||
|
@ -155,7 +152,7 @@ public class FilesStorage {
|
|||
* Foler id
|
||||
* @throws StatAlgoImporterServiceException
|
||||
*/
|
||||
public void deleteFolder(String user, String parentId,String folderName)
|
||||
public void deleteFolder(String user, String parentId, String folderName)
|
||||
throws StatAlgoImporterServiceException {
|
||||
Workspace ws;
|
||||
try {
|
||||
|
@ -167,8 +164,7 @@ public class FilesStorage {
|
|||
"No valid project folder!");
|
||||
}
|
||||
|
||||
WorkspaceItem target = ws.find(
|
||||
folderName, parentId);
|
||||
WorkspaceItem target = ws.find(folderName, parentId);
|
||||
|
||||
if (target != null) {
|
||||
ws.removeItems(target.getId());
|
||||
|
@ -185,10 +181,6 @@ public class FilesStorage {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param user
|
||||
|
@ -198,7 +190,8 @@ public class FilesStorage {
|
|||
* @return Folder
|
||||
* @throws StatAlgoImporterServiceException
|
||||
*/
|
||||
public WorkspaceFolder createFolder(String user, String parentId, String folderName, String folderDescription)
|
||||
public WorkspaceFolder createFolder(String user, String parentId,
|
||||
String folderName, String folderDescription)
|
||||
throws StatAlgoImporterServiceException {
|
||||
Workspace ws;
|
||||
try {
|
||||
|
@ -493,11 +486,12 @@ public class FilesStorage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param user User
|
||||
* @param wi WorkspaceItem
|
||||
* @param user
|
||||
* User
|
||||
* @param wi
|
||||
* WorkspaceItem
|
||||
* @return InputStream
|
||||
* @throws StatAlgoImporterServiceException
|
||||
*/
|
||||
|
@ -508,17 +502,9 @@ public class FilesStorage {
|
|||
|
||||
org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi);
|
||||
is = gcubeItem.getData();
|
||||
return is;
|
||||
|
||||
/*
|
||||
* SMPUrl smsHome = new SMPUrl(gcubeItem.getPublicLink());
|
||||
*
|
||||
* logger.debug("smsHome: [host:" + smsHome.getHost() + " path:" +
|
||||
* smsHome.getPath() + " ref:" + smsHome.getRef() + " userinfo:" +
|
||||
* smsHome.getUserInfo() + " ]"); URLConnection uc = null; uc =
|
||||
* (URLConnection) smsHome.openConnection(); is =
|
||||
* uc.getInputStream();
|
||||
*/
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error retrieving file from storage", e);
|
||||
e.printStackTrace();
|
||||
throw new StatAlgoImporterServiceException(
|
||||
|
@ -526,8 +512,6 @@ public class FilesStorage {
|
|||
+ e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
return is;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -574,7 +558,6 @@ public class FilesStorage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void saveInputStreamInItem(String user, String itemId, InputStream is)
|
||||
throws StatAlgoImporterServiceException {
|
||||
Workspace ws;
|
||||
|
@ -607,7 +590,6 @@ public class FilesStorage {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public File zipFolder(String user, String folderId)
|
||||
throws StatAlgoImporterServiceException {
|
||||
Workspace ws;
|
||||
|
@ -689,6 +671,4 @@ public class FilesStorage {
|
|||
out.close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue