* @param off The start offset
* @param len The number of bytes to write
*/
+ @Override
public void write(byte[] b, int off, int len) {
if ((off < 0)
|| (off > b.length)
* Write a byte to byte array.
* @param b the byte to write
*/
+ @Override
public synchronized void write(int b) {
int inBufferPos = count - filledBufferSum;
if (inBufferPos == currentBuffer.length) {
* @throws IOException never (this method should not declare this exception
* but it has to now due to backwards compatability)
*/
+ @Override
public void close() throws IOException {
//nop
}
* @return the contents of the byte array as a String
* @see java.io.ByteArrayOutputStream#toString()
*/
+ @Override
public String toString() {
return new String(toByteArray());
}
*
* @exception IOException if an error occurs.
*/
+ @Override
protected OutputStream getStream() throws IOException
{
return currentOutputStream;
*
* @exception IOException if an error occurs.
*/
+ @Override
protected void thresholdReached() throws IOException
{
if (prefix != null) {
*
* @exception IOException if an error occurs.
*/
+ @Override
public void close() throws IOException
{
super.close();
/**
* Removes the file contents from the temporary storage.
*/
+ @Override
protected void finalize() {
File outputFile = dfos.getFile();
*
* @return a string representation of this object.
*/
+ @Override
public String toString() {
return "name=" + this.getName()
+ ", StoreLocation="
* Run the reaper thread that will delete files as their associated\r
* marker objects are reclaimed by the garbage collector.\r
*/\r
+ @Override\r
public void run() {\r
// thread exits when exitWhenFinished is true and there are no more tracked objects\r
while (exitWhenFinished == false || trackers.size() > 0) {\r
*
* @return a string describing the delete strategy
*/
+ @Override
public String toString() {
return "FileDeleteStrategy[" + name + "]";
}
* @throws NullPointerException if the file is null
* @throws IOException if an error occurs during file deletion
*/
+ @Override
protected boolean doDelete(File fileToDelete) throws IOException {
FileUtils.forceDelete(fileToDelete);
return true;
*
* @return The factory class for new file items.
*/
+ @Override
public FileItemFactory getFileItemFactory() {
return fileItemFactory;
}
*
* @param factory The factory class for new file items.
*/
+ @Override
public void setFileItemFactory(FileItemFactory factory) {
this.fileItemFactory = factory;
}
throw new FileUploadIOException(e);
}
istream = new LimitedInputStream(istream, fileSizeMax) {
+ @Override
protected void raiseError(long pSizeMax, long pCount)
throws IOException {
itemStream.close(true);
int requestSize = ctx.getContentLength();
if (requestSize == -1) {
input = new LimitedInputStream(input, sizeMax) {
+ @Override
protected void raiseError(long pSizeMax, long pCount)
throws IOException {
FileUploadException ex =
* Returns the exceptions cause.
* @return The exceptions cause, if any, or null.
*/
+ @Override
public Throwable getCause() {
return cause;
}
* Returns the exceptions cause.
* @return The exceptions cause, if any, or null.
*/
+ @Override
public Throwable getCause() {
return cause;
}
*
* @param stream <code>PrintStream</code> to use for output
*/
+ @Override
public void printStackTrace(PrintStream stream) {
super.printStackTrace(stream);
if (cause != null) {
*
* @param writer <code>PrintWriter</code> to use for output
*/
+ @Override
public void printStackTrace(PrintWriter writer) {
super.printStackTrace(writer);
if (cause != null) {
}
}
+ @Override
public Throwable getCause() {
return cause;
}
* @exception IOException if an I/O error occurs.
* @see java.io.FilterInputStream#in
*/
+ @Override
public int read() throws IOException {
int res = super.read();
if (res != -1) {
* @exception IOException if an I/O error occurs.
* @see java.io.FilterInputStream#in
*/
+ @Override
public int read(byte[] b, int off, int len) throws IOException {
int res = super.read(b, off, len);
if (res > 0) {
* @exception IOException if an I/O error occurs.
* @see java.io.FilterInputStream#in
*/
+ @Override
public void close() throws IOException {
closed = true;
super.close();
* @throws IOException An I/O error occurs.
* @return Number of bytes in the buffer.
*/
+ @Override
public int available() throws IOException {
if (pos == -1) {
return tail - head - pad;
* integer, or -1 for EOF.
* @throws IOException An I/O error occurred.
*/
+ @Override
public int read() throws IOException {
if (closed) {
throw new FileItemStream.ItemSkippedException();
* or -1 for EOF.
* @throws IOException An I/O error occurred.
*/
+ @Override
public int read(byte[] b, int off, int len) throws IOException {
if (closed) {
throw new FileItemStream.ItemSkippedException();
* Closes the input stream.
* @throws IOException An I/O error occurred.
*/
+ @Override
public void close() throws IOException {
close(false);
}
* skipped.
* @throws IOException An I/O error occurred.
*/
+ @Override
public long skip(long bytes) throws IOException {
if (closed) {
throw new FileItemStream.ItemSkippedException();
*
* @return a string representation of this object.
*/
+ @Override
public String toString() {
return "ContentLength="
+ this.getContentLength()
*
* @exception IOException if an error occurs.
*/
+ @Override
public void write(int b) throws IOException
{
checkThreshold(1);
*
* @exception IOException if an error occurs.
*/
+ @Override
public void write(byte b[]) throws IOException
{
checkThreshold(b.length);
*
* @exception IOException if an error occurs.
*/
+ @Override
public void write(byte b[], int off, int len) throws IOException
{
checkThreshold(len);
*
* @exception IOException if an error occurs.
*/
+ @Override
public void flush() throws IOException
{
getStream().flush();
*
* @exception IOException if an error occurs.
*/
+ @Override
public void close() throws IOException
{
try