Tabnine Logo
Uploadable
Code IndexAdd Tabnine to your IDE (free)

How to use
Uploadable
in
jodd.http.up

Best Java code snippets using jodd.http.up.Uploadable (Showing top 10 results out of 315)

origin: oblac/jodd

/**
 * Appends {@link jodd.http.up.Uploadable} to buffer.
 */
public Buffer append(final Uploadable uploadable) {
  list.add(uploadable);
  size += uploadable.getSize();
  last = null;
  return this;
}
origin: oblac/jodd

/**
 * Writes content to the writer.
 */
public void writeTo(final Writer writer) throws IOException {
  for (Object o : list) {
    if (o instanceof FastByteBuffer) {
      FastByteBuffer fastByteBuffer = (FastByteBuffer) o;
      byte[] array = fastByteBuffer.toArray();
      writer.write(new String(array, StringPool.ISO_8859_1));
    }
    else if (o instanceof Uploadable) {
      Uploadable uploadable = (Uploadable) o;
      InputStream inputStream = uploadable.openInputStream();
      try {
        StreamUtil.copy(inputStream, writer, StringPool.ISO_8859_1);
      }
      finally {
        StreamUtil.close(inputStream);
      }
    }
  }
}
origin: oblac/jodd

Uploadable uploadable = (Uploadable) o;
InputStream inputStream = uploadable.openInputStream();
int remaining = uploadable.getSize();
origin: oblac/jodd

Uploadable uploadable = (Uploadable) value;
String fileName = uploadable.getFileName();
if (fileName == null) {
  fileName = name;
buffer.append("\"; filename=\"").append(fileName).append('"').append(CRLF);
String mimeType = uploadable.getMimeType();
if (mimeType == null) {
  mimeType = MimeTypes.getMimeType(FileNameUtil.getExtension(fileName));
origin: org.jodd/jodd-http

Uploadable uploadable = (Uploadable) o;
InputStream inputStream = uploadable.openInputStream();
int remaining = uploadable.getSize();
origin: org.jodd/jodd-http

Uploadable uploadable = (Uploadable) value;
String fileName = uploadable.getFileName();
if (fileName == null) {
  fileName = name;
buffer.append("\"; filename=\"").append(fileName).append('"').append(CRLF);
String mimeType = uploadable.getMimeType();
if (mimeType == null) {
  mimeType = MimeTypes.getMimeType(FileNameUtil.getExtension(fileName));
origin: oblac/jodd

/**
 * Writes content to the output stream.
 */
public void writeTo(final OutputStream out) throws IOException {
  for (Object o : list) {
    if (o instanceof FastByteBuffer) {
      FastByteBuffer fastByteBuffer = (FastByteBuffer) o;
      out.write(fastByteBuffer.toArray());
    }
    else if (o instanceof Uploadable) {
      Uploadable uploadable = (Uploadable) o;
      InputStream inputStream = uploadable.openInputStream();
      try {
        StreamUtil.copy(inputStream, out);
      }
      finally {
        StreamUtil.close(inputStream);
      }
    }
  }
}
origin: org.jodd/jodd-http

/**
 * Appends {@link jodd.http.up.Uploadable} to buffer.
 */
public Buffer append(final Uploadable uploadable) {
  list.add(uploadable);
  size += uploadable.getSize();
  last = null;
  return this;
}
origin: org.jodd/jodd-http

/**
 * Writes content to the writer.
 */
public void writeTo(final Writer writer) throws IOException {
  for (Object o : list) {
    if (o instanceof FastByteBuffer) {
      FastByteBuffer fastByteBuffer = (FastByteBuffer) o;
      byte[] array = fastByteBuffer.toArray();
      writer.write(new String(array, StringPool.ISO_8859_1));
    }
    else if (o instanceof Uploadable) {
      Uploadable uploadable = (Uploadable) o;
      InputStream inputStream = uploadable.openInputStream();
      try {
        StreamUtil.copy(inputStream, writer, StringPool.ISO_8859_1);
      }
      finally {
        StreamUtil.close(inputStream);
      }
    }
  }
}
origin: org.jodd/jodd-http

/**
 * Writes content to the output stream.
 */
public void writeTo(final OutputStream out) throws IOException {
  for (Object o : list) {
    if (o instanceof FastByteBuffer) {
      FastByteBuffer fastByteBuffer = (FastByteBuffer) o;
      out.write(fastByteBuffer.toArray());
    }
    else if (o instanceof Uploadable) {
      Uploadable uploadable = (Uploadable) o;
      InputStream inputStream = uploadable.openInputStream();
      try {
        StreamUtil.copy(inputStream, out);
      }
      finally {
        StreamUtil.close(inputStream);
      }
    }
  }
}
jodd.http.upUploadable

Javadoc

Common interface of uploaded content for jodd.http.HttpBase#form(). All supported objects that can be uploaded using the jodd.http.HttpBase#form(String,Object) has to be wrapped with this interface.

Most used methods

  • getFileName
    Returns content file name. If null, the field's name will be used.
  • getMimeType
    Returns MIME type. If null, MIME type will be determined from #getFileName() extension.
  • getSize
    Returns size in bytes.
  • openInputStream
    Opens InputStream. User is responsible for closing it.

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Permission (java.security)
    Legacy security code; do not use.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now