commit for release

master
Lucio Lelii 4 years ago
parent 0befbaeb34
commit 913fa3c9c0

@ -22,7 +22,6 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">

@ -7,7 +7,9 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

@ -0,0 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.2.1] - [2020-07-17]
### Feature
method for description update added

@ -0,0 +1,26 @@
# Acknowledgments
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
- the H2020 research and innovation programme
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);

@ -1,8 +0,0 @@
<ReleaseNotes>
<Changeset component="storagehub-client-1.2.0" date="2020-04-15">
<Change>restore method with destination folder added</Change>
</Changeset>
<Changeset component="storagehub-client-1.0.0" date="2018-05-15">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>

@ -1,31 +0,0 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>servicearchive</id>
<formats>
<format>tar.gz</format>
</formats>
<baseDirectory>/</baseDirectory>
<fileSets>
<fileSet>
<directory>.</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<includes>
<include>README</include>
<include>LICENSE</include>
<include>changelog.xml</include>
<include>profile.xml</include>
</includes>
<fileMode>755</fileMode>
<filtered>true</filtered>
</fileSet>
</fileSets>
<files>
<file>
<source>target/${build.finalName}.jar</source>
<outputDirectory>/${artifactId}</outputDirectory>
</file>
</files>
</assembly>

@ -18,7 +18,7 @@
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-library</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<name>storagehub-client-library</name>
<dependencyManagement>

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID />
<Type>Service</Type>
<Profile>
<Description>${description}</Description>
<Class>Common</Class>
<Name>${artifactId}</Name>
<Version>1.0.0</Version>
<Packages>
<Software>
<Name>${artifactId}</Name>
<Version>${version}</Version>
<MavenCoordinates>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
</MavenCoordinates>
<Files>
<File>${build.finalName}.jar</File>
</Files>
</Software>
</Packages>
</Profile>
</Resource>

@ -97,6 +97,12 @@ public abstract class ItemContainer<I extends Item> {
invalidateItem();
}
public void setDescription(String description) throws StorageHubException {
itemclient.setDescription(this.getId(), description);
invalidateItem();
}
public void setVisible() throws StorageHubException {
itemclient.setHidden(this.getId(), false);
invalidateItem();

@ -1310,6 +1310,40 @@ public class DefaultItemManager implements ItemManagerClient {
}
}
@Override
public String setDescription(String id, String description) throws StorageHubException {
Call<GXWebTargetAdapterRequest, String> call = new Call<GXWebTargetAdapterRequest, String>() {
@Override
public String call(GXWebTargetAdapterRequest manager) throws Exception {
Objects.requireNonNull(id, "id cannot be null");
Objects.requireNonNull(description, "description cannot be null");
GXWebTargetAdapterRequest myManager = manager.path(id)
.path("description");
GXInboundResponse response = myManager.put(Entity.json(description));
if (response.isErrorResponse()) {
if (response.hasException())
throw response.getException();
else
throw new BackendGenericError("HTTP error code is "+response.getHTTPCode());
}
return response.getSource().readEntity(String.class);
}
};
try {
return delegate.make(call);
}catch(StorageHubException e) {
throw e;
}catch(Exception e1) {
throw new RuntimeException(e1);
}
}
@Override
public String setMetadata(String id, Metadata metadata) throws StorageHubException {

@ -85,6 +85,8 @@ public interface ItemManagerClient {
String setMetadata(String id,Metadata metadata) throws StorageHubException;
String setHidden(String id,Boolean value) throws StorageHubException;
String setDescription(String id,String description) throws StorageHubException;
String createGcubeItem(String parentId, GCubeItem item) throws StorageHubException;

@ -10,6 +10,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider;
@ -33,8 +34,8 @@ public class Items {
@BeforeClass
public static void setUp(){
SecurityTokenProvider.instance.set("cf9eb57b-62c0-485d-ae56-d8a32b882808-843339462");
ScopeProvider.instance.set("/d4science.research-infrastructures.eu");
SecurityTokenProvider.instance.set("b7c80297-e4ed-42ab-ab42-fdc0b8b0eabf-98187548");
ScopeProvider.instance.set("/gcube");
}
@ -51,15 +52,11 @@ public class Items {
public void forceDelete() throws Exception{
StorageHubClient shc = new StorageHubClient();
//shc.open("41b904cd-128a-4121-8fd7-82498187ca06").asFolder().getAnchestors().getItems().forEach(i -> System.out.println(i.getTitle()));
shc.open("7ac99eea-d768-4864-a248-6d4ccf43d931").asFile().setDescription("new descr");
long count = shc.getTotalItemCount();
long volume = shc.getTotalVolume();
System.out.println("items are "+count+" volume "+volume);
}
@Test
@ -117,8 +114,8 @@ public class Items {
StorageHubClient shc = new StorageHubClient();
FileContainer file = null;
try(InputStream is = new FileInputStream(new File("/home/lucio/Downloads/.richiesta speroni.pdf"))){
file = shc.getWSRoot().uploadFile(is, ".richiesta speroni.pdf", "test");
try(InputStream is = new FileInputStream(new File("/home/lucio/Downloads/_upwelling_index.py"))){
file = shc.getWSRoot().uploadFile(is, "._upwelling_index.py", "test");
}
@ -343,7 +340,9 @@ public class Items {
}
}
/*
static String baseUrl="http://workspace-repository1-d.d4science.org/storagehub";

Loading…
Cancel
Save