@Override protected ISObject loadBuf() { String fullPath = svc.keyWithContextPath(getKey()); return SObject.of(fullPath, svc.getFile(fullPath)); } }
StorageObject(String key, SVC svc) { super(key); this.svc = svc; setAttributes(svc.getMeta(key)); }
/** * Construct an sobject with specified content in String and a randomly * generated key * * @see #of(String, String) */ public static SObject of(String content) { return new StringSObject(randomKey(), content); }
/** * Construct an sobject with content, key and attributes specified in * {@link Map} */ public static SObject of(String key, String content, Map<String, String> attrs) { SObject sobj = of(key, content); sobj.setAttributes(attrs); return sobj; }
/** * Construct an SObject with random generated key, byte array and number of bytes * @param buf the source byte array * @param len the number of bytes in the array should be stored in the returing object * @return an SObject as described above */ public static SObject of(byte[] buf, int len) { return of(randomKey(), buf, len); }
public static SObject getInvalidObject(String key, Throwable cause) { SObject sobj = of(key, ""); sobj.valid = false; sobj.cause = cause; return sobj; }
public static SObject lazyLoad(String key, IStorageService ss, Map<String, String> conf) { SObject sobj = lazyLoad(key, ss); sobj.setAttributes(conf); return sobj; }
@Override protected void configure(Map<String, String> conf) { super.configure(conf, "azure"); String protocol = getConfValue(conf, CONF_PROTOCOL, ""); String accountKey = getConfValue(conf, CONF_ACCOUNT_KEY, ""); this.accountName = getConfValue(conf, CONF_ACCOUNT_NAME, ""); connect(protocol, accountName, accountKey, conf.get(CONF_BUCKET)); }
private ISObject createDumbObject(String key) { DumbObject obj = new DumbObject(key); setDefAttributes(obj); return obj; }
@Override public InputStream asInputStream() throws UnexpectedIOException { return svc.getInputStream(getKey()); }
@Override public final void remove(String key) { doRemove(keyWithContextPath(key)); }
@Override public ISObject setAttributes(Map<String, String> attrs) { setAttrs(attrs); return this; }
@Override protected StorageServiceBase newService(Map conf) { return new S3Service(conf); } }
@Override protected StorageServiceBase newService(Map<String, String> conf) { return new KodoService(conf); } }
@Override public final ISObject getFull(String key) { ISObject sobj = newSObject(key); return sobj; }
@Override protected StorageServiceBase newService(Map<String, String> conf) { return new AzureService(conf); }
/** * Construct an sobject with content, key and attributes specified in * {@link Map} */ public static SObject of(String key, String content, Map<String, String> attrs) { SObject sobj = of(key, content); sobj.setAttributes(attrs); return sobj; }
@Override public ISObject getLazy(String key, Map<String, String> attrs) { SObject sobj = SObject.lazyLoad(key, this); sobj.setAttributes(attrs); return sobj; }
/** * Construct an sobject with specified content in String and a randomly * generated key * * @see #of(String, String) */ public static SObject of(String content) { return new StringSObject(randomKey(), content); }
@Override public ISObject setAttributes(Map<String, String> attrs) { setAttrs(attrs); return this; }