@@ -27,28 +27,34 @@ This library assists in the interaction with Akamai's NetStorage CMS API. The fo
2727For example, to delete a file:
2828```
2929import com.akamai.netstorage.NetStorage;
30+ import com.akamai.netstorage.DefaultCredential;
3031
31- NetStorage ns = new NetStorage("example.akamaihd.net", "user1", "1234abcd");
32- ns.delete("/1234/example.zip");
32+ DefaultCredential credential = new DefaultCredential("example.akamaihd.net","id of your upload account", "apiKey of upload account");
33+
34+ NetStorage ns = new NetStorage(credential);
35+ ns.delete("/[CP Code]/example.zip");
3336```
3437
3538Other methods return an ` InputStream ` . For example, to retrieve a directory listing:
3639
3740```
3841import com.akamai.netstorage.NetStorage;
39- NetStorage ns = new NetStorage("example.akamaihd.net", "user1", "1234abcd");
42+ import com.akamai.netstorage.DefaultCredential;
43+ DefaultCredential credential = new DefaultCredential("example.akamaihd.net","id of your upload account", "apiKey of upload account");
44+ NetStorage ns = new NetStorage(credential);
4045
41- try (InputStream result = ns.dir("/1234")) {
46+ try (InputStream result = ns.dir("/[CP code]/ 1234")) {
4247 // TODO: consume InputStream
4348}
4449```
4550
4651Finally, when uploading a ` File ` object can be sent or an open ` InputStream ` wll be used
4752```
4853import com.akamai.netstorage.NetStorage;
49-
50- NetStorage ns = new NetStorage("example.akamaihd.net", "user1", "1234abcd");
51- try (InputStream result = ns.upload("/1234/example.zip", new File("../workingdir/srcfile.zip"))) {
54+ import com.akamai.netstorage.DefaultCredential;
55+ DefaultCredential credential = new DefaultCredential("example.akamaihd.net","id of your upload account", "apiKey of upload account");
56+ NetStorage ns = new NetStorage(credential);
57+ try (InputStream result = ns.upload("/[CP code]/1234/example.zip", new File("../workingdir/srcfile.zip"))) {
5258 // TODO: consume InputStream
5359}
5460```
0 commit comments