org.kuali.maven.mojo.s3
Class S3DataConverter

java.lang.Object
  extended by org.kuali.maven.mojo.s3.S3DataConverter

public class S3DataConverter
extends Object

Convert information from an S3 bucket into pojo's


Constructor Summary
S3DataConverter()
           
S3DataConverter(S3BucketContext context)
           
 
Method Summary
protected  void addDisplayRow(DisplayRow displayRow, List<String[]> data)
          Convert a DisplayRow object to a String[]
protected  void addDisplayRows(List<DisplayRow> displayRows, List<String[]> data)
          Convert each DisplayRow object in the list to a String[] and add the String[] to the list of data
 String getBrowseKey()
           
 S3BucketContext getContext()
           
 List<String[]> getData(com.amazonaws.services.s3.model.ObjectListing objectListing, String prefix, String delimiter)
          Convert the ObjectListing into a List of String arrays.
protected  List<DisplayRow> getDirectoryDisplayRows(com.amazonaws.services.s3.model.ObjectListing objectListing, String prefix, String delimiter)
           
protected  DisplayRow getDisplayRow(com.amazonaws.services.s3.model.S3ObjectSummary summary, String prefix, String delimiter)
          Convert an S3ObjectSummary into a DisplayRow object for the UI
protected  DisplayRow getDisplayRow(String commonPrefix, String prefix, String delimiter)
          Convert a commonPrefix into a DisplayRow object for the UI
protected  NumberFormat getNumberFormatInstance()
          Return a NumberFormat that does not using grouping and always displays one fraction digit.
protected  List<DisplayRow> getObjectDisplayRows(com.amazonaws.services.s3.model.ObjectListing objectListing, String prefix, String delimiter)
           
protected  String getShow(String key, String prefix)
          Trim the prefix off of the text we display for this object.
Display "style.css" instead of "css/style.css"
protected  String getTrimmedPrefix(String prefix, String delimiter)
          Convert "foo/bar/css/" into "foo/bar/css"
Convert "foo/bar/css" into "foo/bar"
protected  String getUpOneDirectoryDest(String prefix, String delimiter)
          If prefix is "foo/" and delimiter is "/" return "/"
If prefix is "foo/bar/" and delimiter is "/" return "foo/"
protected  DisplayRow getUpOneDirectoryDisplayRow(String prefix, String delimiter)
          Convert a commonPrefix into a DisplayRow object for the UI
protected  boolean isDirectory(com.amazonaws.services.s3.model.S3ObjectSummary summary, List<String> commonPrefixes, String prefix, String delimiter)
           
 void setBrowseKey(String browseHtml)
           
 void setContext(S3BucketContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

S3DataConverter

public S3DataConverter()

S3DataConverter

public S3DataConverter(S3BucketContext context)
Method Detail

getNumberFormatInstance

protected NumberFormat getNumberFormatInstance()
Return a NumberFormat that does not using grouping and always displays one fraction digit. This is used to display the size of S3 objects in kilobytes


getTrimmedPrefix

protected String getTrimmedPrefix(String prefix,
                                  String delimiter)
Convert "foo/bar/css/" into "foo/bar/css"
Convert "foo/bar/css" into "foo/bar"


addDisplayRows

protected void addDisplayRows(List<DisplayRow> displayRows,
                              List<String[]> data)
Convert each DisplayRow object in the list to a String[] and add the String[] to the list of data


addDisplayRow

protected void addDisplayRow(DisplayRow displayRow,
                             List<String[]> data)
Convert a DisplayRow object to a String[]


getShow

protected String getShow(String key,
                         String prefix)
Trim the prefix off of the text we display for this object.
Display "style.css" instead of "css/style.css"


getDisplayRow

protected DisplayRow getDisplayRow(String commonPrefix,
                                   String prefix,
                                   String delimiter)
Convert a commonPrefix into a DisplayRow object for the UI


getDirectoryDisplayRows

protected List<DisplayRow> getDirectoryDisplayRows(com.amazonaws.services.s3.model.ObjectListing objectListing,
                                                   String prefix,
                                                   String delimiter)

getData

public List<String[]> getData(com.amazonaws.services.s3.model.ObjectListing objectListing,
                              String prefix,
                              String delimiter)
Convert the ObjectListing into a List of String arrays. Each array in the list represents one row in the html table we will be generating


isDirectory

protected boolean isDirectory(com.amazonaws.services.s3.model.S3ObjectSummary summary,
                              List<String> commonPrefixes,
                              String prefix,
                              String delimiter)

getDisplayRow

protected DisplayRow getDisplayRow(com.amazonaws.services.s3.model.S3ObjectSummary summary,
                                   String prefix,
                                   String delimiter)
Convert an S3ObjectSummary into a DisplayRow object for the UI


getObjectDisplayRows

protected List<DisplayRow> getObjectDisplayRows(com.amazonaws.services.s3.model.ObjectListing objectListing,
                                                String prefix,
                                                String delimiter)

getUpOneDirectoryDisplayRow

protected DisplayRow getUpOneDirectoryDisplayRow(String prefix,
                                                 String delimiter)
Convert a commonPrefix into a DisplayRow object for the UI


getUpOneDirectoryDest

protected String getUpOneDirectoryDest(String prefix,
                                       String delimiter)
If prefix is "foo/" and delimiter is "/" return "/"
If prefix is "foo/bar/" and delimiter is "/" return "foo/"


setContext

public void setContext(S3BucketContext context)

getContext

public S3BucketContext getContext()

getBrowseKey

public String getBrowseKey()

setBrowseKey

public void setBrowseKey(String browseHtml)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.