protoj.lang
Class UploadGoogleCodeFeature

java.lang.Object
  extended by protoj.lang.UploadGoogleCodeFeature

public final class UploadGoogleCodeFeature
extends java.lang.Object

This feature is used to upload project artifacts to the google code project website. It is an error to attempt the upload a non existent artifact resulting in application termination.

The most generic way of uploading an artifact to google code is to use the uploadArtifact(File, String, String, String, String, String) method which accepts any file. The following snippet shows how to upload a javadoc foo jar file:

 StandardProject project;
 JavadocArchive archive = project.getArchiveFeature().getJavadocArchive();
 UploadGoogleCodeFeature upload = project.getUploadGoogleCodeFeature();
 
 ArchiveEntry<JavadocArchive> entry = archive.getEntry("foo").getArchiveEntry();
 File artifact = entry.getArtifact();
 upload.uploadArtifact(artifact, "googleproj", "Featured", "release candidate",
                "user", "pass");
 

Author:
Ashley Williams

Constructor Summary
UploadGoogleCodeFeature(StandardProject project, java.lang.String googleProjectName)
          Configures this feature for uploading either the project tar or the project jar depending on the value of the uploadTar argument.
 
Method Summary
 StandardProject getProject()
          The parent project of this feature.
 java.lang.String toString()
           
 void uploadArtifact(java.io.File artifact, java.lang.String googleName, java.lang.String labels, java.lang.String summary, java.lang.String userName, java.lang.String password)
          Uploads the given artifact to the google code project website using the specified information.
 void uploadRelativeArtifact(java.lang.String relativeName, java.lang.String googleName, java.lang.String labels, java.lang.String summary, java.lang.String userName, java.lang.String password)
          Convenience method that delegates to uploadArtifact(File, String, String, String, String, String) with the artifact relative to the project root.
 void uploadTar(java.lang.String googleName, java.lang.String labels, java.lang.String summary, java.lang.String userName, java.lang.String password)
          Convenience method that delegates to uploadArtifact(File, String, String, String, String, String) with the project tar file created via the ProjectArchive class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UploadGoogleCodeFeature

public UploadGoogleCodeFeature(StandardProject project,
                               java.lang.String googleProjectName)
Configures this feature for uploading either the project tar or the project jar depending on the value of the uploadTar argument. See the google code website for further explanation of the remaining parameters.

Parameters:
project - the owning project of this feature
googleProjectName - the name of the google project
Method Detail

uploadTar

public void uploadTar(java.lang.String googleName,
                      java.lang.String labels,
                      java.lang.String summary,
                      java.lang.String userName,
                      java.lang.String password)
Convenience method that delegates to uploadArtifact(File, String, String, String, String, String) with the project tar file created via the ProjectArchive class.

Parameters:
googleName -
labels -
summary -
userName -
password -

uploadRelativeArtifact

public void uploadRelativeArtifact(java.lang.String relativeName,
                                   java.lang.String googleName,
                                   java.lang.String labels,
                                   java.lang.String summary,
                                   java.lang.String userName,
                                   java.lang.String password)
Convenience method that delegates to uploadArtifact(File, String, String, String, String, String) with the artifact relative to the project root. Useful for uploading jar files for example.

Parameters:
relativeName -
googleName -
labels -
summary -
userName -
password -

uploadArtifact

public void uploadArtifact(java.io.File artifact,
                           java.lang.String googleName,
                           java.lang.String labels,
                           java.lang.String summary,
                           java.lang.String userName,
                           java.lang.String password)
Uploads the given artifact to the google code project website using the specified information. The googleName parameter is the name of the file as it will appear on the google code website.

Parameters:
googleName -
labels -
summary -
userName -
password -

getProject

public StandardProject getProject()
The parent project of this feature.

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object