diff options
author | Jani Laakso <jani.laakso@itmill.com> | 2007-12-04 19:51:22 +0000 |
---|---|---|
committer | Jani Laakso <jani.laakso@itmill.com> | 2007-12-04 19:51:22 +0000 |
commit | 3b5793fd5540f8eee3c9a0ef49e2688c9505920c (patch) | |
tree | c60d8b56d5f2fe2772e2728f7ac639f3ff780af1 /src/com/itmill/toolkit/ui/Upload.java | |
parent | 2bfeca0498c879c11f11a54a22ad87cccdaa78c2 (diff) | |
download | vaadin-framework-3b5793fd5540f8eee3c9a0ef49e2688c9505920c.tar.gz vaadin-framework-3b5793fd5540f8eee3c9a0ef49e2688c9505920c.zip |
License header parametrized
Cleanup performed
Organized imports
Format
svn changeset:3162/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/Upload.java')
-rw-r--r-- | src/com/itmill/toolkit/ui/Upload.java | 58 |
1 files changed, 17 insertions, 41 deletions
diff --git a/src/com/itmill/toolkit/ui/Upload.java b/src/com/itmill/toolkit/ui/Upload.java index 998178d0d2..5604465b75 100644 --- a/src/com/itmill/toolkit/ui/Upload.java +++ b/src/com/itmill/toolkit/ui/Upload.java @@ -1,30 +1,6 @@ -/* ************************************************************************* - - IT Mill Toolkit - - Development of Browser User Interfaces Made Easy - - Copyright (C) 2000-2006 IT Mill Ltd - - ************************************************************************* - - This product is distributed under commercial license that can be found - from the product package on license.pdf. Use of this product might - require purchasing a commercial license from IT Mill Ltd. For guidelines - on usage, see licensing-guidelines.html - - ************************************************************************* - - For more information, contact: - - IT Mill Ltd phone: +358 2 4802 7180 - Ruukinkatu 2-4 fax: +358 2 4802 7181 - 20540, Turku email: info@itmill.com - Finland company www: www.itmill.com - - Primary source for information and releases: www.itmill.com - - ********************************************************************** */ +/* +@ITMillApache2LicenseForJavaFiles@ + */ package com.itmill.toolkit.ui; @@ -56,7 +32,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { /** * Should the field be focused on next repaint? */ - private boolean focus = false; + private final boolean focus = false; /** * The tab order number of this field. @@ -114,19 +90,19 @@ public class Upload extends AbstractComponent implements Component.Focusable { } // Gets file properties - String filename = upload.getContentName(); - String type = upload.getContentType(); + final String filename = upload.getContentName(); + final String type = upload.getContentType(); fireStarted(filename, type); // Gets the output target stream - OutputStream out = receiver.receiveUpload(filename, type); + final OutputStream out = receiver.receiveUpload(filename, type); if (out == null) { throw new RuntimeException( "Error getting outputstream from upload receiver"); } - InputStream in = upload.getStream(); + final InputStream in = upload.getStream(); if (null == in) { // No file, for instance non-existent filename in html upload @@ -135,7 +111,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { return; } - byte buffer[] = new byte[BUFFER_SIZE]; + final byte buffer[] = new byte[BUFFER_SIZE]; int bytesRead = 0; totalBytes = 0; try { @@ -155,7 +131,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { endUpload(); requestRepaint(); - } catch (IOException e) { + } catch (final IOException e) { // Download interrupted fireUploadInterrupted(filename, type, totalBytes); @@ -246,7 +222,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { UPLOAD_SUCCEEDED_METHOD = SucceededListener.class .getDeclaredMethod("uploadSucceeded", new Class[] { SucceededEvent.class }); - } catch (java.lang.NoSuchMethodException e) { + } catch (final java.lang.NoSuchMethodException e) { // This should never happen throw new java.lang.RuntimeException("Internal error"); } @@ -271,17 +247,17 @@ public class Upload extends AbstractComponent implements Component.Focusable { /** * Length of the received file. */ - private long length; + private final long length; /** * MIME type of the received file. */ - private String type; + private final String type; /** * Received file name. */ - private String filename; + private final String filename; /** * @@ -413,8 +389,8 @@ public class Upload extends AbstractComponent implements Component.Focusable { * Serial generated by eclipse. */ private static final long serialVersionUID = -3984393770487403525L; - private String filename; - private String type; + private final String filename; + private final String type; /** * @@ -687,7 +663,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { * @see com.itmill.toolkit.ui.Component.Focusable#focus() */ public void focus() { - Window w = getWindow(); + final Window w = getWindow(); if (w != null) { w.setFocusedComponent(this); } |