public MailerContext attach(File... files) { for (File file : files) { attachments.add(SObject.of(file)); } return this; }
/** * Deprecated * * @see #of(String, String, Map) */ @Deprecated public static SObject valueOf(String key, String content, Map<String, String> attrs) { return of(key, content, attrs); }
/** * Deprecated * * @see #of(String, byte[]) */ @Deprecated public static SObject valueOf(String key, byte[] buf) { return of(key, buf); }
/** * Deprecated * * @see #of(String, byte[], String...) */ @Deprecated public static SObject valueOf(String key, byte[] buf, String... attrs) { return of(key, buf, attrs); }
public MailerContext attach(File... files) { for (File file : files) { attachments.add(SObject.of(file)); } return this; }
/** * deprecated * * @see #of(String, InputStream) */ @Deprecated public static SObject valueOf(String key, InputStream is) { return of(key, is); }
/** * Deprecated * * @see #of(String, String, String...) */ @Deprecated public static SObject valueOf(String key, String content, String... attrs) { return of(key, content, attrs); }
/** * Deprecated * * @see #of(String, byte[], Map) */ @Deprecated public static SObject valueOf(String key, byte[] buf, Map<String, String> attrs) { return of(key, buf, attrs); }
/** * Deprecated * * @see #of(String, String) */ @Deprecated public static SObject valueOf(String key, String content) { return of(key, content); }
/** * 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); }
/** * 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 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; }
private SObject resolveFromURL(String url) { try { Response resp = http().newCall(new Request.Builder().url(url).build()).execute(); return SObject.of(resp.body().byteStream()); } catch (IOException e) { throw E.ioException(e); } }
public T send(URL url) { String protocol = url.getProtocol(); if ("file".equals(protocol)) { return send(new File(url.getPath())); } writeBinary(SObject.of(IO.inputStream(url))); return me(); }
/** * Construct an SObject with specified key, file and attributes * specified in {@link Map} * * @see #of(String, File, String...) */ public static SObject of(String key, File file, Map<String, String> attributes) { SObject sobj = of(key, $.requireNotNull(file)); sobj.setAttributes(attributes); return sobj; }
/** * Construct an sobject with key, content and attributes specified in sequence * key1, val1, key2, val2, ... * * @see #of(String, String, Map) */ public static SObject of(String key, String content, String... attrs) { SObject sobj = of(key, content); Map<String, String> map = C.Map(attrs); sobj.setAttributes(map); return sobj; }
/** * Construct an sobject with specified key, content as byte array * and attributes in {@link Map} * * @see #of(String, byte[], String...) */ public static SObject of(String key, byte[] buf, Map<String, String> attrs) { SObject sobj = of(key, $.requireNotNull(buf)); sobj.setAttributes(attrs); return sobj; }
public T send(URL url) { String protocol = url.getProtocol(); if ("file".equals(protocol)) { return send(new File(url.getPath())); } writeBinary(SObject.of(IO.inputStream(url))); return me(); }
/** * Construct an SObject with key, file and attributes specified in * key1, val1, key2, val2... sequence * * @see #of(String, File, Map) */ public static SObject of(String key, File file, String... attrs) { SObject sobj = of(key, $.requireNotNull(file)); Map<String, String> map = C.Map(attrs); sobj.setAttributes(map); return sobj; }
public static SObject valueOf(String key, ISObject copy) { SObject sobj = of(key, copy.asByteArray()); sobj.setAttrs(copy.getAttributes()); return sobj; }