com.wewebu.ow.server.servlets.download
Class OwHttpContentDisposition

java.lang.Object
  extended by com.wewebu.ow.server.servlets.download.OwHttpContentDisposition

public class OwHttpContentDisposition
extends Object

A simple class to generate the HTTP attachment element to be used with Content-Disposition header. This class tries to handle UTF-8 file names in the best possible way for all user agents. Everything is supposed to be UTF-8 encoded.

For a discussion of the specs see

For a discussion on how different user agents handle non ASCI characters in HTML headers see http://blogs.warwick.ac.uk/kieranshaw/entry/utf-8_internationalisation_with.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.2.0.0

Nested Class Summary
static class OwHttpContentDisposition.OwElementType
           OwElementType.
 
Method Summary
static OwHttpContentDisposition forRequest(javax.servlet.http.HttpServletRequest request_p, String fileName_p, OwHttpContentDisposition.OwElementType elementType_p)
          Tries to build the right attachment element for the requesting agent.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

forRequest

public static OwHttpContentDisposition forRequest(javax.servlet.http.HttpServletRequest request_p,
                                                  String fileName_p,
                                                  OwHttpContentDisposition.OwElementType elementType_p)
                                           throws UnsupportedEncodingException
Tries to build the right attachment element for the requesting agent.

Parameters:
request_p - The initial request from the client. We need it in order to detect the user agent.
fileName_p - The name of the file to be used in the attachment element.
elementType_p - inline or attachment
Returns:
an instance of OwHttpContentDisposition
Throws:
UnsupportedEncodingException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.