/** * Returns a string representation of this object. * * @return a string representation of this object. */ @Override public String toString() { return String.format("name=%s, StoreLocation=%s, size=%s bytes, isFormField=%s, FieldName=%s", getName(), getStoreLocation(), Long.valueOf(getSize()), Boolean.valueOf(isFormField()), getFieldName()); }
/** * Returns a string representation of this object. * * @return a string representation of this object. */ @Override public String toString() { return String.format("name=%s, StoreLocation=%s, size=%s bytes, isFormField=%s, FieldName=%s", getName(), getStoreLocation(), Long.valueOf(getSize()), Boolean.valueOf(isFormField()), getFieldName()); }
/** * Returns a string representation of this object. * * @return a string representation of this object. */ @Override public String toString() { return String.format("name=%s, StoreLocation=%s, size=%s bytes, isFormField=%s, FieldName=%s", getName(), getStoreLocation(), Long.valueOf(getSize()), Boolean.valueOf(isFormField()), getFieldName()); }
byte[] fileData = new byte[(int) getSize()]; InputStream fis = null;
byte[] fileData = new byte[(int) getSize()]; InputStream fis = null;
byte[] fileData = new byte[(int) getSize()]; FileInputStream fis = null;
byte[] fileData = new byte[(int) getSize()]; FileInputStream fis = null;
byte[] fileData = new byte[(int) getSize()]; FileInputStream fis = null;
/** * Returns a string representation of this object. * * @return a string representation of this object. */ @Override public String toString() { return "name=" + this.getName() + ", StoreLocation=" + String.valueOf(this.getStoreLocation()) + ", size=" + this.getSize() + "bytes, " + "isFormField=" + isFormField() + ", FieldName=" + this.getFieldName(); }
/** * Returns a string representation of this object. * * @return a string representation of this object. */ @Override public String toString() { return "name=" + this.getName() + ", StoreLocation=" + String.valueOf(this.getStoreLocation()) + ", size=" + this.getSize() + "bytes, " + "isFormField=" + isFormField() + ", FieldName=" + this.getFieldName(); }
/** * Returns a string representation of this object. * * @return a string representation of this object. */ @Override public String toString() { return "name=" + this.getName() + ", StoreLocation=" + String.valueOf(this.getStoreLocation()) + ", size=" + this.getSize() + "bytes, " + "isFormField=" + isFormField() + ", FieldName=" + this.getFieldName(); }
/** * Returns the contents of the file as an array of bytes. If the * contents of the file were not yet cached in memory, they will be * loaded from the disk storage and cached. * * @return The contents of the file as an array of bytes * or {@code null} if the data cannot be read */ @Override public byte[] get() { if (isInMemory()) { if (cachedContent == null && dfos != null) { cachedContent = dfos.getData(); } return cachedContent; } byte[] fileData = new byte[(int) getSize()]; InputStream fis = null; try { fis = new FileInputStream(dfos.getFile()); IOUtils.readFully(fis, fileData); } catch (IOException e) { fileData = null; } finally { IOUtils.closeQuietly(fis); } return fileData; }