org.riedelcastro
Class UploadDescriptor

java.lang.Object
  extended by org.riedelcastro.UploadDescriptor

public class UploadDescriptor
extends java.lang.Object

An UploadDescriptor describes an upload to be performed by the gcupload goal. It implements maven's convention over configuration paradigm by automatically deducing default values for properties based on the project properties.

Author:
Sebastian Riedel

Constructor Summary
UploadDescriptor(org.apache.maven.project.MavenProject project)
          Creates a new default upload descriptor for the given maven project.
UploadDescriptor(org.apache.maven.project.MavenProject project, java.util.Map properties)
          Creates a new upload descriptor using the given property map and maven project for extracting properties of the upload.
 
Method Summary
 java.lang.String[] getExtensions()
          Returns the list of filename extensions.
 java.io.File[] getFilesToUpload()
          Returns the files to upload.
 java.lang.String getId()
          Returns the id of this upload to be used in info messages.
 java.lang.String getPostfix()
          Returns the postfix that the target files have appended to their prefix.
 java.lang.String getPrefix()
          Returns the prefix of the target filenames.
 java.lang.String getSummary()
          Returns the summary of this upload to be added to the file in google code.
 java.lang.String[] getTargetFileNames()
          Return the array of target filenames as defined by the prefix, postfix and extensions.
 void setExtensions(java.lang.String[] extensions)
          Sets the extensions of this upload.
 void setLabels(java.lang.String[] labels)
          Set upload labels.
 void setPostfix(java.lang.String postfix)
          Sets the upload postfix.
 void setPrefix(java.lang.String prefix)
          Sets the upload prefix.
 void setSummary(java.lang.String summary)
          Sets the upload summary.
 java.lang.String toString()
          Returns a string representation of this upload descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UploadDescriptor

public UploadDescriptor(org.apache.maven.project.MavenProject project)
Creates a new default upload descriptor for the given maven project.

Parameters:
project - the maven project to extract default values from.

UploadDescriptor

public UploadDescriptor(org.apache.maven.project.MavenProject project,
                        java.util.Map properties)
Creates a new upload descriptor using the given property map and maven project for extracting properties of the upload.

Parameters:
project - the maven project.
properties - a map with properties for the upload.
Method Detail

getId

public java.lang.String getId()
Returns the id of this upload to be used in info messages.

Returns:
id of this upload (constructed of filename + extensions.

getFilesToUpload

public java.io.File[] getFilesToUpload()
Returns the files to upload.

Returns:
files to upload.

getExtensions

public java.lang.String[] getExtensions()
Returns the list of filename extensions. This is either a user-specified list (through configuration) or a single default extension based on the project packaging property.

Returns:
array of file name extensions.

getPostfix

public java.lang.String getPostfix()
Returns the postfix that the target files have appended to their prefix. For example, if the prefix is "gcupload-maven-plugin-0.9" and the postfix is "jar-with-dependencies" then the filename without extension will be "gcupload-maven-plugin-0.9-jar-with-dependencies". If the postfix is the empty string the hyphen will not be added.

Returns:
the postfix of this upload.

getPrefix

public java.lang.String getPrefix()
Returns the prefix of the target filenames. By default this is artifactId-version.

Returns:
prefix of target filename.

getTargetFileNames

public java.lang.String[] getTargetFileNames()
Return the array of target filenames as defined by the prefix, postfix and extensions.

Returns:
the array of target filenames

getSummary

public java.lang.String getSummary()
Returns the summary of this upload to be added to the file in google code. If no summary has been specified this is deduced from project name, version and postfix.

Returns:
the summary of the upload.

setExtensions

public void setExtensions(java.lang.String[] extensions)
Sets the extensions of this upload.

Parameters:
extensions - the extensions of this upload.

setLabels

public void setLabels(java.lang.String[] labels)
Set upload labels.

Parameters:
labels - labels to attach to uploads.

setPostfix

public void setPostfix(java.lang.String postfix)
Sets the upload postfix.

Parameters:
postfix - upload postfix.

setSummary

public void setSummary(java.lang.String summary)
Sets the upload summary.

Parameters:
summary - the summary for the upload.

setPrefix

public void setPrefix(java.lang.String prefix)
Sets the upload prefix.

Parameters:
prefix - the filename prefix for this upload.

toString

public java.lang.String toString()
Returns a string representation of this upload descriptor.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this upload descriptor.


Copyright © 2009. All Rights Reserved.