1 /*******************************************************************************
2 * Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Innoopract Informationssysteme GmbH - initial API and implementation
10 ******************************************************************************/
12 package org
.eclipse
.rwt
.widgets
.upload
.servlet
;
14 import java
.io
.InputStream
;
18 * This Pojo is used to store a file reference and a progress listener.
19 * It is used for communication between service handler and rap application.
20 * Due to the asynchronous nature of ServiceHandler-requests and access from
21 * the UIThread to instances of this class, all members are access
24 * @author stefan.roeck
26 public class FileUploadStorageItem
{
27 private InputStream fileInputStream
;
28 private String contentType
;
29 private String uploadProcessId
;
30 private long bytesRead
;
31 private long contentLength
;
32 private Exception exception
;
35 public FileUploadStorageItem() {
39 public synchronized InputStream
getFileInputStream() {
40 return this.fileInputStream
;
43 public synchronized void setFileInputStream( final InputStream fileInputStream
) {
44 this.fileInputStream
= fileInputStream
;
47 public synchronized void setContentType( final String contentType
) {
48 this.contentType
= contentType
;
51 public synchronized String
getContentType() {
52 return this.contentType
;
55 public synchronized void setUploadProcessId( final String uploadProcessId
) {
56 this.uploadProcessId
= uploadProcessId
;
59 public synchronized String
getUploadProcessId() {
60 return this.uploadProcessId
;
63 public synchronized void updateProgress(final long bytesRead
, final long contentLength
) {
64 this.bytesRead
= bytesRead
;
65 this.contentLength
= contentLength
;
68 public synchronized long getBytesRead() {
72 public synchronized long getContentLength() {
76 public synchronized void reset() {
80 fileInputStream
= null;
84 public synchronized void setException( Exception e
) {
88 public synchronized Exception
getException() {