org.ow2.dragon.util
Class DragonRepoFileLocator

java.lang.Object
  extended by org.ow2.dragon.util.DragonRepoFileLocator

public class DragonRepoFileLocator
extends java.lang.Object

Author:
Olivier - ebmwebsourcing

Constructor Summary
DragonRepoFileLocator()
           
 
Method Summary
static java.lang.String getRepoFileURL(ContentType type, java.lang.String fileName, java.lang.String fileId, javax.servlet.http.HttpServletRequest request)
          Build a repository file url from "dragon.properties" and given parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DragonRepoFileLocator

public DragonRepoFileLocator()
Method Detail

getRepoFileURL

public static java.lang.String getRepoFileURL(ContentType type,
                                              java.lang.String fileName,
                                              java.lang.String fileId,
                                              javax.servlet.http.HttpServletRequest request)
                                       throws java.io.IOException
Build a repository file url from "dragon.properties" and given parameters. The URL pattern is :
{scheme}://{host}:{port}{contextName} /repository/{fileName}{suffix}?fileId={fileId}

Parameters:
type - the content type of the file, used to choose a file "suffix"
fileName - the file name
fileId - the file unique identifier
context - the servlet context
Returns:
a repository file url
Throws:
java.io.IOException - if the dragon.properties file can't be read


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.