Initial commit
This commit is contained in:
Коммит
f281e2c83f
|
@ -0,0 +1,109 @@
|
|||
*.class
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
|
||||
|
||||
# OS X gitignore
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
|
||||
|
||||
*.iml
|
||||
|
||||
## Directory-based project format:
|
||||
.idea/
|
||||
# if you remove the above rule, at least ignore the following:
|
||||
|
||||
# User-specific stuff:
|
||||
# .idea/workspace.xml
|
||||
# .idea/tasks.xml
|
||||
# .idea/dictionaries
|
||||
|
||||
# Sensitive or high-churn files:
|
||||
# .idea/dataSources.ids
|
||||
# .idea/dataSources.xml
|
||||
# .idea/sqlDataSources.xml
|
||||
# .idea/dynamic.xml
|
||||
# .idea/uiDesigner.xml
|
||||
|
||||
# Gradle:
|
||||
# .idea/gradle.xml
|
||||
# .idea/libraries
|
||||
|
||||
# Mongo Explorer plugin:
|
||||
# .idea/mongoSettings.xml
|
||||
|
||||
## File-based project format:
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
## Plugin-specific files:
|
||||
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
|
||||
|
||||
|
||||
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
|
||||
|
||||
|
||||
work/
|
||||
|
||||
# Dropbox production settings not distributed
|
||||
src/main/java/org/jenkinsci/plugins/publishoverdropbox/domain/ConfigPrivate.java
|
|
@ -0,0 +1,22 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 René de Groot
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
# Publish over Dropbox plugin for Jenkins
|
||||
|
||||
Based on publish-to-ftp and extending publish-to and basic-credentials this Jenkins plugin publishes artifacts in a post-build to dropbox folders without the need to run a sync client on your build server.
|
||||
|
||||
# Installation
|
||||
|
||||
There are 3 options:
|
||||
|
||||
1. ~~Install the plugin through the Jenkins plugin manager.~~ (Not available at this time)
|
||||
2. Install a beta
|
||||
1. Download the latest build is available at: https://github.com/rcgroot/jenkins-publish-over-dropbox-plugin/releases/tag/1.0-rc2
|
||||
2. Install the pre-build publish-over-dropbox-rc2.hpi in the advanced section of the Jenkins plugin manager on an existing Jenkins install.
|
||||
3. Compile your own
|
||||
1. Create an own Dropbox app in the on https://developer.dropbox.com/
|
||||
2. Clone the sources and update the Config.java with your personal client id and client secret.
|
||||
3. Run the "mvn hpi:hpi" on the project source code
|
||||
4. Install the generated publish-over-dropbox.hpi on the advanced section of the plugin manager of your Jenkins installation.
|
||||
# Configuration
|
||||
|
||||
To publish artifacts to a Dropbox there are three levels of configuration. Each level is dependent on the previous.
|
||||
|
||||
### Link an account
|
||||
|
||||
The highest level is connecting a Dropbox account to Jenkins. Dropbox account connections can be created in the **Jenkins > Credentials**.
|
||||
|
||||
<img src="resources/documentation/01-credentials.png"/>
|
||||
|
||||
### Create a location
|
||||
|
||||
The second level is to create a location for a previously linked account. Locations can be created in **Jenkins > Manage Jenkins > Configure System**.
|
||||
|
||||
<img src="resources/documentation/02-location.png"/>
|
||||
|
||||
### Publish files
|
||||
|
||||
The last level is to actual publish files to a Dropbox location. Publishing can be done as **Post-build Actions** in your build job configuration.
|
||||
|
||||
<img src="resources/documentation/03-postbuild.png"/>
|
||||
|
||||
# Credits
|
||||
|
||||
This project builds upon the [publish-over-plugin](https://github.com/jenkinsci/publish-over-plugin) by Anthony Robinson
|
||||
|
||||
Also this project builds upon the [credentials-plugin](https://github.com/jenkinsci/credentials-plugin) by CloudBees, Inc., Stephen Connolly
|
||||
|
||||
And much inspiration was found in the [publish-over-ftp-plugin](https://github.com/jenkinsci/publish-over-ftp-plugin) by Anthony Robinson
|
||||
|
||||
# Licence
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 René de Groot and other contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
MIT License
|
||||
Copyright (c) 2015, René de Groot
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.jenkins-ci.plugins</groupId>
|
||||
<artifactId>plugin</artifactId>
|
||||
<!-- Baseline Jenkins version you use to build and test the plugin. Users must have this version or newer to run. -->
|
||||
<version>1.580.1</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
<groupId>org.jenkins-ci.plugins</groupId>
|
||||
<artifactId>publish-over-dropbox</artifactId>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<packaging>hpi</packaging>
|
||||
|
||||
<name>Publish Over Dropbox</name>
|
||||
<description>Send build artifacts to Dropbox account</description>
|
||||
<url>https://wiki.jenkins-ci.org/display/JENKINS/Publish+over+Dropbox+Plugin</url>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>MIT License</name>
|
||||
<url>http://opensource.org/licenses/MIT</url>
|
||||
<comments>All source code is under the MIT license.</comments>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>rcgroot</id>
|
||||
<name>René de Groot</name>
|
||||
<email>rcgroot@gmail.com</email>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<!-- Assuming you want to host on @jenkinsci: -->
|
||||
<scm>
|
||||
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
|
||||
<url>http://github.com/jenkinsci/${project.artifactId}-plugin</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>repo.jenkins-ci.org</id>
|
||||
<url>http://repo.jenkins-ci.org/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>uk.maven.org</id>
|
||||
<url>http://uk.maven.org/maven2</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>de.tuberlin</id>
|
||||
<url>https://raw.github.com/tawalaya/onedrivejavasdk/mvn-repo/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>always</updatePolicy>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>repo.jenkins-ci.org</id>
|
||||
<url>http://repo.jenkins-ci.org/public/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jenkins-ci.plugins</groupId>
|
||||
<artifactId>publish-over</artifactId>
|
||||
<version>0.18</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jenkins-ci.plugins</groupId>
|
||||
<artifactId>credentials</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.tuberlin</groupId>
|
||||
<artifactId>onedrivesdk</artifactId>
|
||||
<version>0.0.3-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 36 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 31 KiB |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 57 KiB |
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox;
|
||||
|
||||
import com.cloudbees.plugins.credentials.CredentialsNameProvider;
|
||||
import com.cloudbees.plugins.credentials.NameWith;
|
||||
import com.cloudbees.plugins.credentials.common.StandardCredentials;
|
||||
import edu.umd.cs.findbugs.annotations.NonNull;
|
||||
import hudson.Util;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.Messages;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@NameWith(OneDriveToken.NameProvider.class)
|
||||
public interface OneDriveToken extends StandardCredentials {
|
||||
|
||||
@Nonnull
|
||||
String getAuthorizationCode();
|
||||
|
||||
@Nonnull
|
||||
String getAccessCode();
|
||||
|
||||
class NameProvider extends CredentialsNameProvider<OneDriveToken> {
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String getName(@NonNull OneDriveToken credentials) {
|
||||
String description = Util.fixEmptyAndTrim(credentials.getDescription());
|
||||
return description != null ? description : Messages.DropboxTokenImpl_api_token();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.descriptor;
|
||||
|
||||
import com.cloudbees.plugins.credentials.CredentialsProvider;
|
||||
import com.cloudbees.plugins.credentials.domains.DomainRequirement;
|
||||
import de.tuberlin.onedrivesdk.OneDriveException;
|
||||
import de.tuberlin.onedrivesdk.OneDriveFactory;
|
||||
import de.tuberlin.onedrivesdk.OneDriveSDK;
|
||||
import de.tuberlin.onedrivesdk.common.OneDriveScope;
|
||||
import de.tuberlin.onedrivesdk.folder.OneFolder;
|
||||
import hudson.Extension;
|
||||
import hudson.model.Descriptor;
|
||||
import hudson.util.FormValidation;
|
||||
import hudson.util.ListBoxModel;
|
||||
import java.io.IOException;
|
||||
import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.publish_over.BPValidators;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.OneDriveToken;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxHostConfiguration;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxPublisherPlugin;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.Messages;
|
||||
import org.kohsuke.stapler.QueryParameter;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
import org.kohsuke.stapler.StaplerResponse;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
@Extension
|
||||
public class OneDriveHostConfigurationDescriptor extends Descriptor<DropboxHostConfiguration> {
|
||||
|
||||
public OneDriveHostConfigurationDescriptor() {
|
||||
super(DropboxHostConfiguration.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return Messages.hostconfig_descriptor();
|
||||
}
|
||||
|
||||
public int getDefaultTimeout() {
|
||||
return DropboxHostConfiguration.DEFAULT_TIMEOUT;
|
||||
}
|
||||
|
||||
public FormValidation doCheckName(@QueryParameter final String value) {
|
||||
return BPValidators.validateName(value);
|
||||
}
|
||||
|
||||
public FormValidation doCheckTimeout(@QueryParameter final String value) {
|
||||
return FormValidation.validateNonNegativeInteger(value);
|
||||
}
|
||||
|
||||
public FormValidation doCheckRemoteRootDir(@QueryParameter String remoteRootDir) {
|
||||
if (remoteRootDir.matches("/.*")) return FormValidation.ok();
|
||||
else return FormValidation.error(Messages.hostconfig_formvalidation_root());
|
||||
}
|
||||
|
||||
public ListBoxModel doFillTokenItems() {
|
||||
ListBoxModel items = new ListBoxModel();
|
||||
for (OneDriveToken token : getDropboxTokens()) {
|
||||
items.add(token.getDescription(), token.getId());
|
||||
}
|
||||
if (items.size() > 0) {
|
||||
items.get(0).selected = true;
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
private List<OneDriveToken> getDropboxTokens() {
|
||||
return CredentialsProvider.lookupCredentials(OneDriveToken.class, Jenkins.getInstance(), null, (DomainRequirement) null);
|
||||
}
|
||||
|
||||
/*
|
||||
public FormValidation doTestConnection(final StaplerRequest request, final StaplerResponse response) {
|
||||
final DropboxPublisherPlugin.Descriptor pluginDescriptor = Jenkins.getInstance().getDescriptorByType(
|
||||
DropboxPublisherPlugin.Descriptor.class);
|
||||
return pluginDescriptor.doTestConnection(request, response);
|
||||
}
|
||||
*/
|
||||
|
||||
public FormValidation doTestConnection(@QueryParameter("name") final String name, @QueryParameter("token") final String token, @QueryParameter("remoteRootDir") final String dir) throws IOException, ServletException, OneDriveException {
|
||||
//final DropboxTokenImpl pluginDescriptor = Jenkins.getInstance().getDescriptorByType(DropboxTokenImpl.Descriptor.class);
|
||||
String refreshToken = null;
|
||||
List<OneDriveToken> tokens = CredentialsProvider.lookupCredentials(OneDriveToken.class, Jenkins.getInstance(), null, (DomainRequirement) null);
|
||||
for (OneDriveToken token2 : tokens) {
|
||||
refreshToken = token2.getAccessCode();
|
||||
}
|
||||
OneDriveSDK sdk = OneDriveFactory.createOneDriveSDK("0000000048170EFD", "NNe3LAukrteNJZ7CEyitDJw2q2aHpBNl", "https://login.live.com/oauth20_desktop.srf", OneDriveScope.READWRITE);
|
||||
|
||||
try{
|
||||
sdk.authenticateWithRefreshToken(refreshToken);
|
||||
OneFolder rootFolder = sdk.getRootFolder();
|
||||
System.out.println(rootFolder);
|
||||
return FormValidation.ok("Succesfully authenticated using token: " + refreshToken);
|
||||
}catch(OneDriveException ex) {
|
||||
return FormValidation.error("Error authenticating using token: " + refreshToken);
|
||||
}
|
||||
|
||||
//return FormValidation.ok("Token: " + refreshToken +"\nRemote Dir: " + dir + "\nName: " + name);
|
||||
}
|
||||
public jenkins.plugins.publish_over.view_defaults.HostConfiguration.Messages getCommonFieldNames() {
|
||||
return new jenkins.plugins.publish_over.view_defaults.HostConfiguration.Messages();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.descriptor;
|
||||
|
||||
import hudson.Extension;
|
||||
import hudson.model.Descriptor;
|
||||
import jenkins.model.Jenkins;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxPublisher;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxPublisherPlugin;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.Messages;
|
||||
|
||||
@Extension
|
||||
public class OneDrivePublisherDescriptor extends Descriptor<DropboxPublisher> {
|
||||
|
||||
public OneDrivePublisherDescriptor() {
|
||||
super(DropboxPublisher.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return Messages.publisher_descriptor();
|
||||
}
|
||||
|
||||
public DropboxPublisherPlugin.Descriptor getPublisherPluginDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(DropboxPublisherPlugin.Descriptor.class);
|
||||
}
|
||||
|
||||
public OneDriveTransferDescriptor getTransferDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(OneDriveTransferDescriptor.class);
|
||||
}
|
||||
|
||||
public jenkins.plugins.publish_over.view_defaults.BapPublisher.Messages getCommonFieldNames() {
|
||||
return new jenkins.plugins.publish_over.view_defaults.BapPublisher.Messages();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.descriptor;
|
||||
|
||||
import hudson.Util;
|
||||
import hudson.model.AbstractProject;
|
||||
import hudson.model.TaskListener;
|
||||
import hudson.tasks.BuildStepDescriptor;
|
||||
import hudson.tasks.Publisher;
|
||||
import hudson.util.CopyOnWriteList;
|
||||
import hudson.util.FormValidation;
|
||||
import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.publish_over.*;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxHostConfiguration;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxPublisherPlugin;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.Messages;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
import org.kohsuke.stapler.StaplerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class OneDrivePublisherPluginDescriptor extends BuildStepDescriptor<Publisher> {
|
||||
|
||||
private final CopyOnWriteList<DropboxHostConfiguration> hostConfigurations = new CopyOnWriteList<DropboxHostConfiguration>();
|
||||
/**
|
||||
* null - prevent complaints from xstream
|
||||
*/
|
||||
private BPPluginDescriptor.BPDescriptorMessages msg;
|
||||
/**
|
||||
* null - prevent complaints from xstream
|
||||
*/
|
||||
private Class hostConfigClass;
|
||||
|
||||
public OneDrivePublisherPluginDescriptor() {
|
||||
super(DropboxPublisherPlugin.class);
|
||||
load();
|
||||
}
|
||||
|
||||
|
||||
public String getDisplayName() {
|
||||
return Messages.descriptor_displayName();
|
||||
}
|
||||
|
||||
public boolean isApplicable(final Class<? extends AbstractProject> aClass) {
|
||||
return !BPPlugin.PROMOTION_JOB_TYPE.equals(aClass.getCanonicalName());
|
||||
}
|
||||
|
||||
public List<DropboxHostConfiguration> getHostConfigurations() {
|
||||
return hostConfigurations.getView();
|
||||
}
|
||||
|
||||
public DropboxHostConfiguration getConfiguration(final String name) {
|
||||
for (DropboxHostConfiguration configuration : hostConfigurations) {
|
||||
if (configuration.getName().equals(name)) {
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean configure(final StaplerRequest request, final JSONObject formData) {
|
||||
hostConfigurations.replaceBy(request.bindJSONToList(DropboxHostConfiguration.class, formData.get("instance")));
|
||||
save();
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canSetMasterNodeName() {
|
||||
return JenkinsCapabilities.missing(JenkinsCapabilities.MASTER_HAS_NODE_NAME);
|
||||
}
|
||||
|
||||
public String getDefaultMasterNodeName() {
|
||||
return BPInstanceConfig.DEFAULT_MASTER_NODE_NAME;
|
||||
}
|
||||
|
||||
public boolean isEnableOverrideDefaults() {
|
||||
return JenkinsCapabilities.available(JenkinsCapabilities.SIMPLE_DESCRIPTOR_SELECTOR);
|
||||
}
|
||||
|
||||
public OneDrivePublisherDescriptor getPublisherDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(OneDrivePublisherDescriptor.class);
|
||||
}
|
||||
|
||||
public OneDriveHostConfigurationDescriptor getHostConfigurationDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(OneDriveHostConfigurationDescriptor.class);
|
||||
}
|
||||
|
||||
public jenkins.plugins.publish_over.view_defaults.BPInstanceConfig.Messages getCommonFieldNames() {
|
||||
return new jenkins.plugins.publish_over.view_defaults.BPInstanceConfig.Messages();
|
||||
}
|
||||
|
||||
public jenkins.plugins.publish_over.view_defaults.manage_jenkins.Messages getCommonManageMessages() {
|
||||
return new jenkins.plugins.publish_over.view_defaults.manage_jenkins.Messages();
|
||||
}
|
||||
|
||||
public FormValidation doTestConnection(final StaplerRequest request, final StaplerResponse response) {
|
||||
final DropboxHostConfiguration hostConfig = request.bindParameters(DropboxHostConfiguration.class, "");
|
||||
final BPBuildInfo buildInfo = createDummyBuildInfo();
|
||||
try {
|
||||
hostConfig.createClient(buildInfo).disconnect();
|
||||
return FormValidation.ok(Messages.form_testConnection_ok());
|
||||
} catch (Exception e) {
|
||||
return FormValidation.errorWithMarkup("<p>"
|
||||
+ Messages.form_testConnection_error() + "</p><p><pre>"
|
||||
+ Util.escape(e.getClass().getCanonicalName() + ": " + e.getLocalizedMessage())
|
||||
+ "</pre></p>");
|
||||
}
|
||||
}
|
||||
|
||||
private BPBuildInfo createDummyBuildInfo() {
|
||||
return new BPBuildInfo(
|
||||
TaskListener.NULL,
|
||||
"",
|
||||
Jenkins.getInstance().getRootPath(),
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public Object readResolve() {
|
||||
// nuke the legacy config
|
||||
msg = null;
|
||||
hostConfigClass = null;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.descriptor;
|
||||
|
||||
import hudson.Extension;
|
||||
import hudson.model.Descriptor;
|
||||
import hudson.util.FormValidation;
|
||||
import jenkins.model.Jenkins;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxPublisherPlugin;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxTransfer;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.Messages;
|
||||
import org.kohsuke.stapler.QueryParameter;
|
||||
|
||||
@Extension
|
||||
public class OneDriveTransferDescriptor extends Descriptor<DropboxTransfer> {
|
||||
|
||||
public OneDriveTransferDescriptor() {
|
||||
super(DropboxTransfer.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return Messages.transfer_descriptor();
|
||||
}
|
||||
|
||||
public DropboxPublisherPlugin.Descriptor getPublisherPluginDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(DropboxPublisherPlugin.Descriptor.class);
|
||||
}
|
||||
|
||||
public FormValidation doCheckSourceFiles(@QueryParameter final String value) {
|
||||
return FormValidation.validateRequired(value);
|
||||
}
|
||||
|
||||
public boolean canUseExcludes() {
|
||||
return DropboxTransfer.canUseExcludes();
|
||||
}
|
||||
|
||||
public jenkins.plugins.publish_over.view_defaults.BPTransfer.Messages getCommonFieldNames() {
|
||||
return new jenkins.plugins.publish_over.view_defaults.BPTransfer.Messages();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain;
|
||||
|
||||
public class Config {
|
||||
/**
|
||||
* Generate these values by creating your own Dropbox app registration on https://www.dropbox.com/developers/apps
|
||||
* <br/>
|
||||
* Replace the strings values in this file to run your own compiled version of the plugin
|
||||
*/
|
||||
static final String CLIENT_ID = "0000000048170EFD";
|
||||
/**
|
||||
* @see Config#CLIENT_ID
|
||||
*/
|
||||
static final String CLIENT_SECRET = "NNe3LAukrteNJZ7CEyitDJw2q2aHpBNl";
|
||||
private static String authorizeUrl = "https://login.live.com/oauth20_authorize.srf?client_id="+CLIENT_ID+"&scope=wl.signin%20wl.basic%20wl.offline_access%20wl.skydrive_update&response_type=code&redirect_uri=https://login.live.com/oauth20_desktop.srf";
|
||||
//private static final String authorizeUrl = "https://www.dropbox.com/1/oauth2/authorize?response_type=code&client_id=" + CLIENT_ID;
|
||||
|
||||
public static String getAuthorizeUrl() {
|
||||
return authorizeUrl;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public class FormBuilder {
|
||||
|
||||
public static final String CONTENT_TYPE = "application/x-www-form-urlencoded";
|
||||
public static final String AND = "&";
|
||||
public static final String UTF_8 = "UTF-8";
|
||||
public static final String EQUALS = "=";
|
||||
private final StringBuilder query = new StringBuilder();
|
||||
|
||||
public FormBuilder appendQueryParameter(String key, String value) throws UnsupportedEncodingException {
|
||||
if (query.length() > 0) {
|
||||
query.append(AND);
|
||||
}
|
||||
query.append(URLEncoder.encode(key, UTF_8));
|
||||
query.append(EQUALS);
|
||||
query.append(URLEncoder.encode(value, UTF_8));
|
||||
return this;
|
||||
}
|
||||
|
||||
public String build() {
|
||||
return query.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.model.BaseResponse;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.model.RestException;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.Messages;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
public class JsonObjectRequest<T> {
|
||||
|
||||
private static final String HEADER_CONTENT_TYPE = "Content-Type";
|
||||
public static final String UTF_8 = "UTF-8";
|
||||
public static final String METHOD_POST = "POST";
|
||||
public static final String METHOD_GET = "GET";
|
||||
public static final String OCTET_STREAM = "application/octet-stream";
|
||||
public static final String PARAM_AUTHORIZATION = "Authorization";
|
||||
public static final String VALUE_BEARER = "Bearer ";
|
||||
public static final int TIMEOUT_30_SECONDS = 30000;
|
||||
|
||||
private final URL url;
|
||||
private InputStream bodyStream;
|
||||
private String contentType;
|
||||
private final Gson gson;
|
||||
private final Class<T> classOfT;
|
||||
private String bearerToken;
|
||||
private int timeout = TIMEOUT_30_SECONDS;
|
||||
|
||||
public JsonObjectRequest(URL url, Gson gson, Class<T> classOfT) {
|
||||
this.url = url;
|
||||
this.gson = gson;
|
||||
this.classOfT = classOfT;
|
||||
this.contentType = null;
|
||||
}
|
||||
|
||||
public JsonObjectRequest(URL url, InputStream content, String contentType, Gson gson, Class<T> classOfT) {
|
||||
this(url, gson, classOfT);
|
||||
this.contentType = contentType;
|
||||
this.bodyStream = content;
|
||||
}
|
||||
|
||||
public JsonObjectRequest(URL url, String content, String contentType, Gson gson, Class<T> classOfT) {
|
||||
this(url, gson, classOfT);
|
||||
this.contentType = contentType;
|
||||
try {
|
||||
bodyStream = new ByteArrayInputStream(content.getBytes(UTF_8));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Ignored
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public T execute() throws RestException {
|
||||
T model;
|
||||
HttpURLConnection connection;
|
||||
InputStream inputStream = null;
|
||||
InputStream errorStream = null;
|
||||
try {
|
||||
connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setReadTimeout(timeout);
|
||||
connection.setConnectTimeout(timeout);
|
||||
|
||||
if (bearerToken != null) {
|
||||
signWithBearerToken(connection);
|
||||
}
|
||||
|
||||
if (bodyStream != null) {
|
||||
upload(connection, METHOD_POST);
|
||||
} else {
|
||||
download(connection);
|
||||
}
|
||||
|
||||
int responseCode = connection.getResponseCode();
|
||||
String responseMessage = connection.getResponseMessage();
|
||||
if (responseCode < 200 || responseCode > 299) {
|
||||
errorStream = connection.getErrorStream();
|
||||
model = readModel(errorStream);
|
||||
String description = "";
|
||||
if (model instanceof BaseResponse && ((BaseResponse) model).hasError()) {
|
||||
description = " : " + ((BaseResponse) model).getErrorDescription();
|
||||
}
|
||||
throw new RestException(Messages.exception_rest_http(responseCode, responseMessage, description));
|
||||
}
|
||||
inputStream = connection.getInputStream();
|
||||
model = readModel(inputStream);
|
||||
} catch (IOException e) {
|
||||
throw new RestException(Messages.exception_rest_connection(), e);
|
||||
} finally {
|
||||
closeQuietly(errorStream);
|
||||
closeQuietly(inputStream);
|
||||
}
|
||||
if (model == null) {
|
||||
throw new RestException(Messages.exception_rest_model());
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
private void signWithBearerToken(HttpURLConnection connection) {
|
||||
connection.setRequestProperty(PARAM_AUTHORIZATION, VALUE_BEARER + bearerToken);
|
||||
}
|
||||
|
||||
private void download(HttpURLConnection connection) throws IOException {
|
||||
connection.setRequestMethod(METHOD_GET);
|
||||
connection.setDoOutput(false);
|
||||
}
|
||||
|
||||
private void upload(HttpURLConnection connection, String method) throws IOException {
|
||||
connection.setRequestMethod(method);
|
||||
connection.setDoOutput(true);
|
||||
if (contentType != null) {
|
||||
connection.addRequestProperty(HEADER_CONTENT_TYPE, contentType);
|
||||
} else {
|
||||
// Leaving content type null will result in malformed requests, not setting it will result in an incorrect value
|
||||
connection.addRequestProperty(HEADER_CONTENT_TYPE, OCTET_STREAM);
|
||||
}
|
||||
DataOutputStream outputStream = null;
|
||||
try {
|
||||
OutputStream stream = connection.getOutputStream();
|
||||
outputStream = new DataOutputStream(stream);
|
||||
IOUtils.copy(bodyStream, outputStream);
|
||||
outputStream.flush();
|
||||
} finally {
|
||||
closeQuietly(bodyStream);
|
||||
closeQuietly(outputStream);
|
||||
}
|
||||
}
|
||||
|
||||
private void closeQuietly(Closeable closeable) {
|
||||
if (closeable != null) {
|
||||
try {
|
||||
closeable.close();
|
||||
} catch (IOException e) {
|
||||
//Ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private T readModel(InputStream inputStream) throws IOException {
|
||||
T model = null;
|
||||
if (inputStream != null) {
|
||||
InputStreamReader reader = null;
|
||||
try {
|
||||
reader = new InputStreamReader(inputStream);
|
||||
model = gson.fromJson(reader, classOfT);
|
||||
} finally {
|
||||
closeQuietly(reader);
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
public void sign(String accessCode) {
|
||||
this.bearerToken = accessCode;
|
||||
}
|
||||
|
||||
public void setTimeout(int timeout) {
|
||||
this.timeout = timeout;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,489 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import de.tuberlin.onedrivesdk.OneDriveException;
|
||||
import de.tuberlin.onedrivesdk.OneDriveFactory;
|
||||
import de.tuberlin.onedrivesdk.OneDriveSDK;
|
||||
import de.tuberlin.onedrivesdk.common.OneDriveScope;
|
||||
import de.tuberlin.onedrivesdk.file.OneFile;
|
||||
import de.tuberlin.onedrivesdk.folder.OneFolder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.model.*;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.Messages;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
public class OneDrive {
|
||||
|
||||
private static final String URL_TOKEN = "https://login.live.com/oauth20_token.srf?";
|
||||
private static final String REDIRECT_URI = "https://login.live.com/oauth20_desktop.srf";
|
||||
|
||||
/*
|
||||
private static final String URL_ACCOUNT_INFO = "https://api.dropbox.com/1/account/info";
|
||||
private static final String URL_FILE_METADATA = "https://api.dropbox.com/1/metadata/auto";
|
||||
private static final String URL_OPS_CREATE_FOLDER = "https://api.dropbox.com/1/fileops/create_folder";
|
||||
private static final String URL_FILE_UPLOAD = "https://api-content.dropbox.com/1/files_put/auto";
|
||||
private static final String URL_OPS_DELETE_FILE = "https://api.dropbox.com/1/fileops/delete";
|
||||
*/
|
||||
|
||||
private static final Gson gson = new Gson();
|
||||
public static final String PARAM_ROOT = "root";
|
||||
public static final String PARAM_PATH = "path";
|
||||
public static final String PARAM_LOCALE = "locale";
|
||||
public static final String PATH_SEPERATOR = "/";
|
||||
public static final String PARAM_OVERWRITE = "overwrite";
|
||||
public static final String PARAM_AUTORENAME = "autorename";
|
||||
public static final String PARAM_PARENT_REV = "parent_rev";
|
||||
public static final String VALUE_TRUE = "true";
|
||||
public static final String VALUE_FALSE = "false";
|
||||
public static final String VALUE_AUTHORIZATION_CODE = "authorization_code";
|
||||
public static final long MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
|
||||
private final String accessToken;
|
||||
private AccountInfo userInfo;
|
||||
private int timeout = -1;
|
||||
|
||||
//private Folder workingFolder;
|
||||
private OneFolder workingFolder;
|
||||
|
||||
private static final OneDriveSDK sdk = OneDriveFactory.createOneDriveSDK(Config.CLIENT_ID, Config.CLIENT_SECRET, "https://login.live.com/oauth20_desktop.srf", OneDriveScope.READWRITE);
|
||||
|
||||
public OneDrive(String accessToken) {
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public void setTimeout(int timeout) {
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public int getTimeout() {
|
||||
return timeout;
|
||||
}
|
||||
|
||||
public boolean connect() throws IOException, OneDriveException {
|
||||
//userInfo = retrieveAccountInfo(accessToken);
|
||||
// return isConnected();
|
||||
try{
|
||||
sdk.authenticateWithRefreshToken(accessToken);
|
||||
}catch(OneDriveException ex) {
|
||||
throw new OneDriveException("Error connecting to OneDrive, could not be authenticated." + ex);
|
||||
}
|
||||
return isConnected();
|
||||
}
|
||||
|
||||
public boolean isConnected() {
|
||||
//return !StringUtils.isEmpty(accessToken) && userInfo != null;
|
||||
return sdk.isAuthenticated();
|
||||
}
|
||||
|
||||
public boolean changeWorkingDirectory(String relative) throws IOException, RestException, OneDriveException {
|
||||
boolean hasSuccess = true;
|
||||
try {
|
||||
if (!StringUtils.isEmpty(relative)) {
|
||||
workingFolder = retrieveFolderMetaData(relative);
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
hasSuccess = false;
|
||||
}
|
||||
//return workingFolder != null && hasSuccess && workingFolder.isDir();
|
||||
return hasSuccess && workingFolder != null;
|
||||
}
|
||||
|
||||
public boolean disconnect() throws OneDriveException, IOException {
|
||||
try{
|
||||
sdk.disconnect();
|
||||
return true;
|
||||
} catch (IOException e){
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
private Folder retrieveFolderMetaData(String relative) throws RestException {
|
||||
String absolute = createAbsolutePath(relative);
|
||||
URL url;
|
||||
try {
|
||||
url = new URLBuilder(URL_FILE_METADATA)
|
||||
.appendPath(absolute)
|
||||
.build();
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RestException(Messages.exception_dropbox_url(), e);
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RestException(Messages.exception_dropbox_url(), e);
|
||||
}
|
||||
JsonObjectRequest<Folder> request = new JsonObjectRequest<Folder>(url, gson, Folder.class);
|
||||
request.setTimeout(timeout);
|
||||
request.sign(accessToken);
|
||||
final Folder folder;
|
||||
try {
|
||||
folder = request.execute();
|
||||
} catch (IOException e) {
|
||||
throw new RestException(Messages.exception_dropbox_folder(url), e);
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
*/
|
||||
|
||||
private OneFolder retrieveFolderMetaData(String relative) throws RestException, IOException, OneDriveException{
|
||||
String absolute = createAbsolutePath(relative);
|
||||
OneFolder folder = sdk.getFolderByPath(absolute);
|
||||
return folder;
|
||||
}
|
||||
|
||||
/*
|
||||
private File retrieveFileMetaData(String relative) throws IOException {
|
||||
String absolute = createAbsolutePath(relative);
|
||||
URL url;
|
||||
try {
|
||||
url = new URLBuilder(URL_FILE_METADATA)
|
||||
.appendPath(absolute)
|
||||
.build();
|
||||
} catch (URISyntaxException e) {
|
||||
throw new IOException(Messages.exception_dropbox_url(), e);
|
||||
}
|
||||
JsonObjectRequest<File> request = new JsonObjectRequest<File>(url, gson, File.class);
|
||||
request.setTimeout(timeout);
|
||||
request.sign(accessToken);
|
||||
|
||||
return request.execute();
|
||||
}
|
||||
*/
|
||||
|
||||
private OneFile retrieveFileMetaData(String relative) throws IOException, OneDriveException {
|
||||
String absolute = createAbsolutePath(relative);
|
||||
OneFile file = sdk.getFileByPath(absolute);
|
||||
return file;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
public Folder makeDirectory(String relative) throws IOException {
|
||||
String absolute = createAbsolutePath(relative);
|
||||
URL url = getUrl(URL_OPS_CREATE_FOLDER);
|
||||
String body = new FormBuilder()
|
||||
.appendQueryParameter(PARAM_ROOT, workingFolder.getRoot())
|
||||
.appendQueryParameter(PARAM_PATH, absolute)
|
||||
.appendQueryParameter(PARAM_LOCALE, getDropboxLocale())
|
||||
.build();
|
||||
String contentType = FormBuilder.CONTENT_TYPE;
|
||||
|
||||
JsonObjectRequest<Folder> request = new JsonObjectRequest<Folder>(url, body, contentType, gson, Folder.class);
|
||||
request.setTimeout(timeout);
|
||||
request.sign(accessToken);
|
||||
|
||||
return request.execute();
|
||||
}
|
||||
*/
|
||||
public OneFolder makeDirectory(String dirName) throws IOException, OneDriveException {
|
||||
//String absolute = createAbsolutePath(relative);
|
||||
OneFolder folder = sdk.getRootFolder().createFolder(dirName);
|
||||
return folder;
|
||||
}
|
||||
|
||||
|
||||
public File storeFile(String name, InputStream content) throws IOException, OneDriveException {
|
||||
String absolute = createAbsolutePath(name);
|
||||
URL url;
|
||||
String parentRev = null;
|
||||
try {
|
||||
File file = (File) retrieveFileMetaData(name);
|
||||
parentRev = file.getRev();
|
||||
} catch (IOException e) {
|
||||
// Ignore, assume file doesn't exist
|
||||
}
|
||||
/*
|
||||
try {
|
||||
final URLBuilder builder = new URLBuilder(URL_FILE_UPLOAD);
|
||||
builder.appendPath(absolute)
|
||||
.appendQueryParameter(PARAM_LOCALE, getDropboxLocale())
|
||||
.appendQueryParameter(PARAM_OVERWRITE, VALUE_TRUE)
|
||||
.appendQueryParameter(PARAM_AUTORENAME, VALUE_FALSE);
|
||||
if (parentRev != null) {
|
||||
builder.appendQueryParameter(PARAM_PARENT_REV, parentRev);
|
||||
}
|
||||
url = builder.build();
|
||||
} catch (URISyntaxException e) {
|
||||
throw new IOException(Messages.exception_dropbox_url(), e);
|
||||
}
|
||||
|
||||
JsonObjectRequest<File> request = new JsonObjectRequest<File>(url, content, null, gson, File.class);
|
||||
|
||||
request.setTimeout(timeout);
|
||||
request.sign(accessToken);
|
||||
|
||||
return request.execute();
|
||||
*/
|
||||
return null;
|
||||
|
||||
}
|
||||
/*
|
||||
public boolean storeFile(String name, InputStream content) throws IOException{
|
||||
|
||||
// Needs to be passed file (Might need to change Params
|
||||
java.io.File oneDriveTestFile = new java.io.File("");
|
||||
|
||||
try{
|
||||
sdk.getRootFolder().uploadFile(oneDriveTestFile).startUpload();
|
||||
}catch (OneDriveException ex) {
|
||||
Logger.getLogger(OneDrive.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
public void cleanFolder() throws IOException {
|
||||
if (workingFolder.isDir()) {
|
||||
for (BaseFile file : workingFolder.getContents()) {
|
||||
DeletedFile deletedFile = deleteFile(file);
|
||||
if (!deletedFile.isDeleted()) {
|
||||
throw new IOException(Messages.exception_dropbox_delete());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new IOException(Messages.exception_dropbox_deleteIsNotFolder());
|
||||
}
|
||||
}
|
||||
*/
|
||||
public void cleanFolder() throws IOException, OneDriveException{
|
||||
// get contents of entire folder
|
||||
// delete all files in folder that are not directories
|
||||
String id = workingFolder.getId();
|
||||
List<OneFile> files = sdk.getFolderById(id).getChildFiles();
|
||||
for (OneFile file : files) {
|
||||
try{
|
||||
file.delete();
|
||||
}catch(OneDriveException e){
|
||||
throw new OneDriveException("Error deleting file from OneDrive. " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public void pruneFolder(String absoluteRemoteRoot, int pruneRootDays) throws IOException, RestException, OneDriveException {
|
||||
SimpleDateFormat df = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.US);
|
||||
Date cutoff = new Date(System.currentTimeMillis() - pruneRootDays * MILLISECONDS_PER_DAY);
|
||||
OneFolder root = retrieveFolderMetaData(absoluteRemoteRoot);
|
||||
if (root.isDir()) {
|
||||
for (BaseFile file : root.getContents()) {
|
||||
Date lastModified;
|
||||
try {
|
||||
lastModified = df.parse(file.getModified());
|
||||
} catch (ParseException e) {
|
||||
throw new IOException("Was unable to read Dropbox date format", e);
|
||||
}
|
||||
if (lastModified.before(cutoff))
|
||||
deleteFile(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
public void pruneFolder(String absoluteRemoteRoot, int pruneRootDays) throws IOException, RestException, OneDriveException {
|
||||
SimpleDateFormat df = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.US);
|
||||
}
|
||||
|
||||
/*
|
||||
private DeletedFile deleteFile(BaseFile file) throws RestException {
|
||||
// URL url = getUrl(URL_OPS_DELETE_FILE);
|
||||
URL url = getURl("");
|
||||
String body;
|
||||
try {
|
||||
body = new FormBuilder()
|
||||
.appendQueryParameter(PARAM_ROOT, file.getRoot())
|
||||
.appendQueryParameter(PARAM_PATH, file.getPath())
|
||||
.appendQueryParameter(PARAM_LOCALE, getDropboxLocale())
|
||||
.build();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RestException(Messages.exception_dropbox_body(), e);
|
||||
}
|
||||
JsonObjectRequest<DeletedFile> request = new JsonObjectRequest<DeletedFile>(url, body, FormBuilder.CONTENT_TYPE, gson, DeletedFile.class);
|
||||
request.setTimeout(timeout);
|
||||
request.sign(accessToken);
|
||||
|
||||
return request.execute();
|
||||
}
|
||||
*/
|
||||
private void deleteFile(OneFile file) throws RestException, IOException{
|
||||
try {
|
||||
file.delete();
|
||||
} catch (OneDriveException ex) {
|
||||
Logger.getLogger(OneDrive.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
private AccountInfo retrieveAccountInfo(String accessToken) throws RestException {
|
||||
URL url = getUrl(URL_ACCOUNT_INFO);
|
||||
|
||||
JsonObjectRequest<AccountInfo> request = new JsonObjectRequest<AccountInfo>(url, gson, AccountInfo.class);
|
||||
request.setTimeout(timeout);
|
||||
request.sign(accessToken);
|
||||
|
||||
return request.execute();
|
||||
}
|
||||
|
||||
public static String convertAuthorizationToAccessCode(String authorizationCode) throws IOException {
|
||||
if (StringUtils.isEmpty(authorizationCode)) {
|
||||
return "";
|
||||
}
|
||||
String accessToken = readAccessTokenFromProvider(authorizationCode);
|
||||
if (accessToken == null) {
|
||||
accessToken = readAccessTokenFromWeb(authorizationCode);
|
||||
}
|
||||
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
private static String readAccessTokenFromWeb(String authorizationCode) throws RestException, UnsupportedEncodingException {
|
||||
String accessToken;
|
||||
URL url = getUrl(URL_TOKEN);
|
||||
FormBuilder builder = new FormBuilder()
|
||||
.appendQueryParameter("code", authorizationCode)
|
||||
.appendQueryParameter("grant_type", VALUE_AUTHORIZATION_CODE)
|
||||
.appendQueryParameter("client_id", Config.CLIENT_ID);
|
||||
try {
|
||||
// Apply production config not included in source distribution
|
||||
Class privateConfig = Class.forName("org.jenkinsci.plugins.publishoverdropbox.domain.ConfigPrivate");
|
||||
Class[] argClass = {builder.getClass()};
|
||||
Method method = privateConfig.getDeclaredMethod("append", argClass);
|
||||
method.invoke(null, builder);
|
||||
} catch (Exception e) {
|
||||
// Apply local development parameters
|
||||
builder.appendQueryParameter("client_secret", Config.CLIENT_SECRET);
|
||||
}
|
||||
String body = builder.build();
|
||||
|
||||
String contentType = FormBuilder.CONTENT_TYPE;
|
||||
JsonObjectRequest<TokenResponse> request = new JsonObjectRequest<TokenResponse>(url, body, contentType, gson, TokenResponse.class);
|
||||
TokenResponse response = request.execute();
|
||||
accessToken = response.getAccessToken();
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
private static String readAccessTokenFromProvider(String authorizationCode) {
|
||||
String accessToken = null;
|
||||
List<OneDriveToken> tokens = CredentialsProvider.lookupCredentials(OneDriveToken.class, Jenkins.getInstance(), null, (DomainRequirement) null);
|
||||
for (OneDriveToken token : tokens) {
|
||||
if (token.getAuthorizationCode().equals(authorizationCode)) {
|
||||
accessToken = token.getAccessCode();
|
||||
}
|
||||
}
|
||||
return accessToken;
|
||||
}
|
||||
*/
|
||||
|
||||
public static String convertAuthorizationToAccessCode(String authorizationCode) throws IOException {
|
||||
if (StringUtils.isEmpty(authorizationCode)) {
|
||||
return "";
|
||||
}
|
||||
//String accessToken = readAccessTokenFromProvider(authorizationCode);
|
||||
String accessToken = null;
|
||||
if (accessToken == null) {
|
||||
accessToken = readAccessTokenFromWeb(authorizationCode);
|
||||
}
|
||||
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
private static String readAccessTokenFromWeb(String authorizationCode) throws RestException, UnsupportedEncodingException {
|
||||
String accessToken;
|
||||
URL url = getUrl(URL_TOKEN);
|
||||
FormBuilder builder = new FormBuilder()
|
||||
.appendQueryParameter("client_id", Config.CLIENT_ID)
|
||||
.appendQueryParameter("client_secret", Config.CLIENT_SECRET)
|
||||
.appendQueryParameter("code", authorizationCode)
|
||||
.appendQueryParameter("grant_type", VALUE_AUTHORIZATION_CODE)
|
||||
.appendQueryParameter("redirect_uri", REDIRECT_URI);
|
||||
|
||||
try {
|
||||
// Apply production config not included in source distribution
|
||||
//Class privateConfig = Class.forName("org.jenkinsci.plugins.publishoverdropbox.domain.ConfigPrivate");
|
||||
//Class[] argClass = {builder.getClass()};
|
||||
//Method method = privateConfig.getDeclaredMethod("append", argClass);
|
||||
// method.invoke(null, builder);
|
||||
} catch (Exception e) {
|
||||
// Apply local development parameters
|
||||
// builder.appendQueryParameter("client_secret", Config.CLIENT_SECRET);
|
||||
}
|
||||
String body = builder.build();
|
||||
|
||||
String contentType = FormBuilder.CONTENT_TYPE;
|
||||
JsonObjectRequest<TokenResponse> request = new JsonObjectRequest<TokenResponse>(url, body, contentType, gson, TokenResponse.class);
|
||||
TokenResponse response = request.execute();
|
||||
accessToken = response.getAccessToken();
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
private static URL getUrl(String urlSource) throws RestException {
|
||||
URL url;
|
||||
try {
|
||||
url = new URLBuilder(urlSource).build();
|
||||
} catch (URISyntaxException e) {
|
||||
throw new RestException(Messages.exception_dropbox_url(), e);
|
||||
} catch (MalformedURLException e) {
|
||||
throw new RestException(Messages.exception_dropbox_url(), e);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
private String getDropboxLocale() {
|
||||
return Locale.getDefault().toLanguageTag();
|
||||
}
|
||||
|
||||
private String createAbsolutePath(final String path) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (path.startsWith(PATH_SEPERATOR)) {
|
||||
// paths starting with / are already absolute
|
||||
sb.append(path);
|
||||
} else {
|
||||
// relative paths are prefix with the working folder
|
||||
if (workingFolder != null) {
|
||||
//sb.append(workingFolder.getPath());
|
||||
}
|
||||
|
||||
// When working folder is the root the path could end with '/'
|
||||
if (sb.length() == 0 || !PATH_SEPERATOR.equals(sb.substring(sb.length() - 1))) {
|
||||
sb.append(PATH_SEPERATOR);
|
||||
}
|
||||
sb.append(path);
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain;
|
||||
|
||||
import de.tuberlin.onedrivesdk.OneDriveException;
|
||||
import de.tuberlin.onedrivesdk.folder.OneFolder;
|
||||
import hudson.FilePath;
|
||||
import jenkins.plugins.publish_over.BPBuildInfo;
|
||||
import jenkins.plugins.publish_over.BPDefaultClient;
|
||||
import jenkins.plugins.publish_over.BapPublisherException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.model.Folder;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.DropboxTransfer;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.impl.Messages;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.model.RestException;
|
||||
|
||||
public class OneDriveClient extends BPDefaultClient<DropboxTransfer> {
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(OneDriveClient.class);
|
||||
private BPBuildInfo buildInfo;
|
||||
private final OneDrive onedrive;
|
||||
private String token;
|
||||
|
||||
public OneDriveClient(final OneDrive client, final BPBuildInfo buildInfo) {
|
||||
this.onedrive = client;
|
||||
this.buildInfo = buildInfo;
|
||||
}
|
||||
|
||||
public BPBuildInfo getBuildInfo() {
|
||||
return buildInfo;
|
||||
}
|
||||
|
||||
public void setBuildInfo(final BPBuildInfo buildInfo) {
|
||||
this.buildInfo = buildInfo;
|
||||
}
|
||||
|
||||
public boolean changeDirectory(final String directory) {
|
||||
try {
|
||||
return onedrive.changeWorkingDirectory(directory);
|
||||
} catch (IOException ioe) {
|
||||
throw new BapPublisherException(Messages.exception_cwdException(directory), ioe);
|
||||
} catch (OneDriveException ex) {
|
||||
Logger.getLogger(OneDriveClient.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean makeDirectory(final String directory) {
|
||||
try {
|
||||
OneFolder folder = onedrive.makeDirectory(directory);
|
||||
return folder != null;
|
||||
} catch (IOException ioe) {
|
||||
throw new BapPublisherException(Messages.exception_mkdirException(directory), ioe);
|
||||
} catch (OneDriveException ex) {
|
||||
Logger.getLogger(OneDriveClient.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void deleteTree() throws OneDriveException {
|
||||
try {
|
||||
onedrive.cleanFolder();
|
||||
} catch (IOException ioe) {
|
||||
throw new BapPublisherException(Messages.exception_failedToStoreFile("Cleaning failed"), ioe);
|
||||
}
|
||||
}
|
||||
|
||||
public void beginTransfers(final DropboxTransfer transfer) {
|
||||
if (!transfer.hasConfiguredSourceFiles()) {
|
||||
throw new BapPublisherException(Messages.exception_noSourceFiles());
|
||||
}
|
||||
if (transfer.isRemoteDirectorySDF() && transfer.isPruneRoot()) {
|
||||
try {
|
||||
onedrive.pruneFolder(getAbsoluteRemoteRoot(), transfer.getPruneRootDays());
|
||||
} catch (IOException ioe) {
|
||||
throw new BapPublisherException(Messages.exception_failedToStoreFile("Pruning failed"), ioe);
|
||||
} catch (OneDriveException ex) {
|
||||
Logger.getLogger(OneDriveClient.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void transferFile(final DropboxTransfer transfer, final FilePath filePath, final InputStream content) throws OneDriveException {
|
||||
try {
|
||||
onedrive.storeFile(filePath.getName(), content);
|
||||
} catch (IOException ioe) {
|
||||
throw new BapPublisherException(Messages.exception_failedToStoreFile("Storing failed"), ioe);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean connect() throws OneDriveException {
|
||||
try {
|
||||
return onedrive.isConnected() || onedrive.connect();
|
||||
} catch (IOException ioe) {
|
||||
throw new BapPublisherException(Messages.exception_exceptionOnDisconnect(ioe.getLocalizedMessage()), ioe);
|
||||
}
|
||||
}
|
||||
|
||||
public void disconnect() throws OneDriveException {
|
||||
if ((onedrive != null) && onedrive.isConnected()) {
|
||||
try {
|
||||
onedrive.disconnect();
|
||||
} catch (IOException ioe) {
|
||||
throw new BapPublisherException(Messages.exception_exceptionOnDisconnect(ioe.getLocalizedMessage()), ioe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void disconnectQuietly() {
|
||||
try {
|
||||
onedrive.disconnect();
|
||||
} catch (OneDriveException e) {
|
||||
LOG.warn(Messages.log_disconnectQuietly(), e);
|
||||
} catch (IOException e) {
|
||||
LOG.warn(Messages.log_disconnectQuietly(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setTimeout(int timeout) {
|
||||
onedrive.setTimeout(timeout);
|
||||
}
|
||||
|
||||
public int getTimeout() {
|
||||
return onedrive.getTimeout();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.*;
|
||||
|
||||
class URLBuilder {
|
||||
String scheme = "";
|
||||
String host = "";
|
||||
String path = "";
|
||||
String query = "";
|
||||
|
||||
|
||||
public URLBuilder(String uri) throws URISyntaxException {
|
||||
URI parseUri = new URI(uri);
|
||||
scheme = parseUri.getScheme() == null ? "" : parseUri.getScheme();
|
||||
host = parseUri.getHost() == null ? "" : parseUri.getHost();
|
||||
path = parseUri.getPath() == null ? "" : parseUri.getPath();
|
||||
query = parseUri.getQuery() == null ? "" : parseUri.getQuery();
|
||||
}
|
||||
|
||||
public URLBuilder appendQueryParameter(String key, String value) throws UnsupportedEncodingException {
|
||||
StringBuilder sb = new StringBuilder(query);
|
||||
if (sb.length() > 0) {
|
||||
sb.append("&");
|
||||
}
|
||||
sb.append(URLEncoder.encode(key, "UTF-8"));
|
||||
sb.append("=");
|
||||
sb.append(URLEncoder.encode(value, "UTF-8"));
|
||||
query = sb.toString();
|
||||
return this;
|
||||
}
|
||||
|
||||
public URLBuilder appendPath(String str) {
|
||||
StringBuilder sb = new StringBuilder(path);
|
||||
if (sb.charAt(sb.length() - 1) != '/' && !str.startsWith("/")) {
|
||||
sb.append('/');
|
||||
}
|
||||
sb.append(str);
|
||||
path = sb.toString();
|
||||
return this;
|
||||
}
|
||||
|
||||
public URL build() throws MalformedURLException {
|
||||
StringBuilder sb = new StringBuilder(path);
|
||||
if (query.length() > 0) {
|
||||
sb.append("?");
|
||||
sb.append(query);
|
||||
}
|
||||
return new URL(scheme, host, sb.toString());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,327 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class AccountInfo {
|
||||
|
||||
@Expose
|
||||
private Long uid;
|
||||
@SerializedName("display_name")
|
||||
@Expose
|
||||
private String displayName;
|
||||
@SerializedName("name_details")
|
||||
@Expose
|
||||
private NameDetails nameDetails;
|
||||
@SerializedName("referral_link")
|
||||
@Expose
|
||||
private String referralLink;
|
||||
@Expose
|
||||
private String country;
|
||||
@Expose
|
||||
private String locale;
|
||||
@SerializedName("is_paired")
|
||||
@Expose
|
||||
private Boolean isPaired;
|
||||
@Expose
|
||||
private Team team;
|
||||
@SerializedName("quota_info")
|
||||
@Expose
|
||||
private QuotaInfo quotaInfo;
|
||||
|
||||
/**
|
||||
* @return The uid
|
||||
*/
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uid The uid
|
||||
*/
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The displayName
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param displayName The display_name
|
||||
*/
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The nameDetails
|
||||
*/
|
||||
public NameDetails getNameDetails() {
|
||||
return nameDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nameDetails The name_details
|
||||
*/
|
||||
public void setNameDetails(NameDetails nameDetails) {
|
||||
this.nameDetails = nameDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The referralLink
|
||||
*/
|
||||
public String getReferralLink() {
|
||||
return referralLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param referralLink The referral_link
|
||||
*/
|
||||
public void setReferralLink(String referralLink) {
|
||||
this.referralLink = referralLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The country
|
||||
*/
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param country The country
|
||||
*/
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The locale
|
||||
*/
|
||||
public String getLocale() {
|
||||
return locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param locale The locale
|
||||
*/
|
||||
public void setLocale(String locale) {
|
||||
this.locale = locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The isPaired
|
||||
*/
|
||||
public Boolean getIsPaired() {
|
||||
return isPaired;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isPaired The is_paired
|
||||
*/
|
||||
public void setIsPaired(Boolean isPaired) {
|
||||
this.isPaired = isPaired;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The team
|
||||
*/
|
||||
public Team getTeam() {
|
||||
return team;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param team The team
|
||||
*/
|
||||
public void setTeam(Team team) {
|
||||
this.team = team;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The quotaInfo
|
||||
*/
|
||||
public QuotaInfo getQuotaInfo() {
|
||||
return quotaInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param quotaInfo The quota_info
|
||||
*/
|
||||
public void setQuotaInfo(QuotaInfo quotaInfo) {
|
||||
this.quotaInfo = quotaInfo;
|
||||
}
|
||||
|
||||
public class NameDetails {
|
||||
|
||||
@SerializedName("familiar_name")
|
||||
@Expose
|
||||
private String familiarName;
|
||||
@SerializedName("given_name")
|
||||
@Expose
|
||||
private String givenName;
|
||||
@Expose
|
||||
private String surname;
|
||||
|
||||
/**
|
||||
* @return The familiarName
|
||||
*/
|
||||
public String getFamiliarName() {
|
||||
return familiarName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param familiarName The familiar_name
|
||||
*/
|
||||
public void setFamiliarName(String familiarName) {
|
||||
this.familiarName = familiarName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The givenName
|
||||
*/
|
||||
public String getGivenName() {
|
||||
return givenName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param givenName The given_name
|
||||
*/
|
||||
public void setGivenName(String givenName) {
|
||||
this.givenName = givenName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The surname
|
||||
*/
|
||||
public String getSurname() {
|
||||
return surname;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param surname The surname
|
||||
*/
|
||||
public void setSurname(String surname) {
|
||||
this.surname = surname;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class QuotaInfo {
|
||||
|
||||
@Expose
|
||||
private Long shared;
|
||||
@Expose
|
||||
private Long quota;
|
||||
@Expose
|
||||
private Long normal;
|
||||
|
||||
/**
|
||||
* @return The shared
|
||||
*/
|
||||
public Long getShared() {
|
||||
return shared;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param shared The shared
|
||||
*/
|
||||
public void setShared(Long shared) {
|
||||
this.shared = shared;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The quota
|
||||
*/
|
||||
public Long getQuota() {
|
||||
return quota;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param quota The quota
|
||||
*/
|
||||
public void setQuota(Long quota) {
|
||||
this.quota = quota;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The normal
|
||||
*/
|
||||
public Long getNormal() {
|
||||
return normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param normal The normal
|
||||
*/
|
||||
public void setNormal(Long normal) {
|
||||
this.normal = normal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class Team {
|
||||
|
||||
@Expose
|
||||
private String name;
|
||||
@SerializedName("team_id")
|
||||
@Expose
|
||||
private String teamId;
|
||||
|
||||
/**
|
||||
* @return The name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name The name
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The teamId
|
||||
*/
|
||||
public String getTeamId() {
|
||||
return teamId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param teamId The team_id
|
||||
*/
|
||||
public void setTeamId(String teamId) {
|
||||
this.teamId = teamId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,237 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BaseFile {
|
||||
|
||||
@Expose
|
||||
private String size;
|
||||
@Expose
|
||||
private String rev;
|
||||
@Expose
|
||||
private String modified;
|
||||
@Expose
|
||||
private String path;
|
||||
@SerializedName("is_dir")
|
||||
@Expose
|
||||
private boolean isDir;
|
||||
@Expose
|
||||
private String icon;
|
||||
@Expose
|
||||
private String root;
|
||||
@Expose
|
||||
private long bytes;
|
||||
@SerializedName("thumb_exists")
|
||||
@Expose
|
||||
private boolean thumbExists;
|
||||
@Expose
|
||||
private long revision;
|
||||
|
||||
|
||||
/**
|
||||
* @return The size
|
||||
*/
|
||||
public String getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param size The size
|
||||
*/
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The rev
|
||||
*/
|
||||
public String getRev() {
|
||||
return rev;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rev The rev
|
||||
*/
|
||||
public void setRev(String rev) {
|
||||
this.rev = rev;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The modified
|
||||
*/
|
||||
public String getModified() {
|
||||
return modified;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param modified The modified
|
||||
*/
|
||||
public void setModified(String modified) {
|
||||
this.modified = modified;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The path
|
||||
*/
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param path The path
|
||||
*/
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The isDir
|
||||
*/
|
||||
public boolean isDir() {
|
||||
return isDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isDir The is_dir
|
||||
*/
|
||||
public void setIsDir(boolean isDir) {
|
||||
this.isDir = isDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The icon
|
||||
*/
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param icon The icon
|
||||
*/
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The root
|
||||
*/
|
||||
public String getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param root The root
|
||||
*/
|
||||
public void setRoot(String root) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The bytes
|
||||
*/
|
||||
public long getBytes() {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bytes The bytes
|
||||
*/
|
||||
public void setBytes(long bytes) {
|
||||
this.bytes = bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The thumbExists
|
||||
*/
|
||||
public boolean isThumbExists() {
|
||||
return thumbExists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param thumbExists The thumb_exists
|
||||
*/
|
||||
public void setThumbExists(boolean thumbExists) {
|
||||
this.thumbExists = thumbExists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The revision
|
||||
*/
|
||||
public long getRevision() {
|
||||
return revision;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param revision The revision
|
||||
*/
|
||||
public void setRevision(long revision) {
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public class PhotoInfo {
|
||||
|
||||
@SerializedName("lat_long")
|
||||
@Expose
|
||||
private List<Float> latLong = new ArrayList<Float>();
|
||||
@SerializedName("time_taken")
|
||||
@Expose
|
||||
private String timeTaken;
|
||||
|
||||
/**
|
||||
* @return The latLong
|
||||
*/
|
||||
public List<Float> getLatLong() {
|
||||
return latLong;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param latLong The lat_long
|
||||
*/
|
||||
public void setLatLong(List<Float> latLong) {
|
||||
this.latLong = latLong;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The timeTaken
|
||||
*/
|
||||
public String getTimeTaken() {
|
||||
return timeTaken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timeTaken The time_taken
|
||||
*/
|
||||
public void setTimeTaken(String timeTaken) {
|
||||
this.timeTaken = timeTaken;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
abstract public class BaseResponse {
|
||||
|
||||
@SerializedName("error_description")
|
||||
private String errorDescription;
|
||||
@SerializedName("error")
|
||||
private String error;
|
||||
|
||||
public boolean hasError() {
|
||||
return error != null || errorDescription != null;
|
||||
}
|
||||
|
||||
public String getErrorDescription() {
|
||||
return errorDescription;
|
||||
}
|
||||
|
||||
public void setErrorDescription(String errorDescription) {
|
||||
this.errorDescription = errorDescription;
|
||||
}
|
||||
|
||||
public String getError() {
|
||||
return error;
|
||||
}
|
||||
|
||||
public void setError(String error) {
|
||||
this.error = error;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class DeletedFile extends BaseFile {
|
||||
|
||||
@SerializedName("is_deleted")
|
||||
@Expose
|
||||
private Boolean isDeleted;
|
||||
@SerializedName("mime_type")
|
||||
@Expose
|
||||
private String mimeType;
|
||||
|
||||
/**
|
||||
* @return The isDeleted
|
||||
*/
|
||||
public Boolean isDeleted() {
|
||||
return isDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isDeleted The is_deleted
|
||||
*/
|
||||
public void setDeleted(Boolean isDeleted) {
|
||||
this.isDeleted = isDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The mimeType
|
||||
*/
|
||||
public String getMimeType() {
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mimeType The mime_type
|
||||
*/
|
||||
public void setMimeType(String mimeType) {
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class File extends BaseFile {
|
||||
|
||||
@SerializedName("client_mtime")
|
||||
@Expose
|
||||
private String clientMtime;
|
||||
|
||||
@SerializedName("photo_info")
|
||||
@Expose
|
||||
private PhotoInfo photoInfo;
|
||||
|
||||
@SerializedName("mime_type")
|
||||
@Expose
|
||||
private String mimeType;
|
||||
|
||||
/**
|
||||
* @return The photoInfo
|
||||
*/
|
||||
public PhotoInfo getPhotoInfo() {
|
||||
return photoInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param photoInfo The photo_info
|
||||
*/
|
||||
public void setPhotoInfo(PhotoInfo photoInfo) {
|
||||
this.photoInfo = photoInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The mimeType
|
||||
*/
|
||||
public String getMimeType() {
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mimeType The mime_type
|
||||
*/
|
||||
public void setMimeType(String mimeType) {
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Folder extends BaseFile {
|
||||
|
||||
@Expose
|
||||
private String hash;
|
||||
|
||||
@Expose
|
||||
private List<BaseFile> contents = new ArrayList<BaseFile>();
|
||||
|
||||
/**
|
||||
* @return The hash
|
||||
*/
|
||||
public String getHash() {
|
||||
return hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hash The hash
|
||||
*/
|
||||
public void setHash(String hash) {
|
||||
this.hash = hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The contents
|
||||
*/
|
||||
public List<BaseFile> getContents() {
|
||||
return contents;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contents The contents
|
||||
*/
|
||||
public void setContents(List<BaseFile> contents) {
|
||||
this.contents = contents;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain.model;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class RestException extends IOException {
|
||||
public RestException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public RestException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public RestException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public RestException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.domain.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class TokenResponse extends BaseResponse {
|
||||
@SerializedName("refresh_token")
|
||||
private String accessToken;
|
||||
@SerializedName("token_type")
|
||||
private String tokenType;
|
||||
@SerializedName("uid")
|
||||
private String uid;
|
||||
|
||||
public String getAccessToken() {
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
public void setAccessToken(String accessToken) {
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public String getTokenType() {
|
||||
return tokenType;
|
||||
}
|
||||
|
||||
public void setTokenType(String tokenType) {
|
||||
this.tokenType = tokenType;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,167 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.impl;
|
||||
|
||||
import com.cloudbees.plugins.credentials.CredentialsProvider;
|
||||
import com.cloudbees.plugins.credentials.domains.DomainRequirement;
|
||||
import de.tuberlin.onedrivesdk.OneDriveException;
|
||||
import hudson.model.Describable;
|
||||
import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.publish_over.BPBuildInfo;
|
||||
import jenkins.plugins.publish_over.BPHostConfiguration;
|
||||
import jenkins.plugins.publish_over.BapPublisherException;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringStyle;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.OneDriveToken;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.descriptor.OneDriveHostConfigurationDescriptor;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.OneDrive;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.OneDriveClient;
|
||||
import org.kohsuke.stapler.DataBoundConstructor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class DropboxHostConfiguration extends BPHostConfiguration<OneDriveClient, Object> implements Describable<DropboxHostConfiguration> {
|
||||
|
||||
public static final int DEFAULT_TIMEOUT = 300000;
|
||||
private static final long serialVersionUID = 1L;
|
||||
private OneDriveToken token;
|
||||
private final int timeout;
|
||||
|
||||
@DataBoundConstructor
|
||||
public DropboxHostConfiguration(final String name, final String token, final String remoteRootDir, final int timeout) {
|
||||
super(name, null, null, null, remoteRootDir, 0);
|
||||
this.timeout = timeout;
|
||||
this.token = token == null ? null : lookupTokenId(token);
|
||||
}
|
||||
|
||||
private OneDriveToken lookupTokenId(String tokenId) {
|
||||
List<OneDriveToken> credentials = CredentialsProvider.lookupCredentials(OneDriveToken.class, Jenkins.getInstance(), null, (DomainRequirement) null);
|
||||
for (OneDriveToken token : credentials) {
|
||||
if (tokenId.equals(token.getId())) {
|
||||
return token;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public OneDriveToken getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(final OneDriveToken token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OneDriveClient createClient(final BPBuildInfo buildInfo) {
|
||||
final OneDriveClient client = new OneDriveClient(createOneDrive(), buildInfo);
|
||||
try {
|
||||
init(client);
|
||||
} catch (IOException ioe) {
|
||||
throw new BapPublisherException(Messages.exception_bap_createclient(ioe.getLocalizedMessage()), ioe);
|
||||
} catch (OneDriveException ex) {
|
||||
Logger.getLogger(DropboxHostConfiguration.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return client;
|
||||
}
|
||||
|
||||
private OneDrive createOneDrive() {
|
||||
return new OneDrive(token.getAccessCode());
|
||||
}
|
||||
|
||||
private void init(final OneDriveClient client) throws IOException, OneDriveException {
|
||||
configureOneDriveClient(client);
|
||||
connect(client);
|
||||
|
||||
|
||||
// client.changeDirectory("/BRIAN");
|
||||
//client.makeDirectory("BRIAN");
|
||||
|
||||
changeToRootDirectory(client);
|
||||
setRootDirectoryInClient(client);
|
||||
}
|
||||
|
||||
private void configureOneDriveClient(final OneDriveClient client) {
|
||||
client.setTimeout(timeout);
|
||||
client.setToken(token.getAuthorizationCode());
|
||||
}
|
||||
|
||||
private void connect(final OneDriveClient client) throws IOException, OneDriveException {
|
||||
final BPBuildInfo buildInfo = client.getBuildInfo();
|
||||
if (!client.connect()) {
|
||||
exception(client, Messages.exception_bap_logInFailed(getToken()));
|
||||
}
|
||||
}
|
||||
|
||||
private void setRootDirectoryInClient(final OneDriveClient client) throws IOException {
|
||||
if (isDirectoryAbsolute(getRemoteRootDir())) {
|
||||
client.setAbsoluteRemoteRoot(getRemoteRootDir());
|
||||
}
|
||||
}
|
||||
|
||||
public OneDriveHostConfigurationDescriptor getDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(OneDriveHostConfigurationDescriptor.class);
|
||||
}
|
||||
|
||||
protected HashCodeBuilder addToHashCode(final HashCodeBuilder builder) {
|
||||
return super.addToHashCode(builder)
|
||||
.append(token)
|
||||
.append(timeout);
|
||||
}
|
||||
|
||||
protected EqualsBuilder addToEquals(final EqualsBuilder builder, final DropboxHostConfiguration that) {
|
||||
return super.addToEquals(builder, that)
|
||||
.append(token, that.token)
|
||||
.append(timeout, that.timeout);
|
||||
}
|
||||
|
||||
protected ToStringBuilder addToToString(final ToStringBuilder builder) {
|
||||
return super.addToToString(builder)
|
||||
.append("token", token)
|
||||
.append("timeout", timeout);
|
||||
}
|
||||
|
||||
public boolean equals(final Object that) {
|
||||
if (this == that) return true;
|
||||
if (that == null || getClass() != that.getClass()) return false;
|
||||
|
||||
return addToEquals(new EqualsBuilder(), (DropboxHostConfiguration) that).isEquals();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return addToHashCode(new HashCodeBuilder()).toHashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.impl;
|
||||
|
||||
import hudson.model.Describable;
|
||||
import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.publish_over.BapPublisher;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringStyle;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.descriptor.OneDrivePublisherDescriptor;
|
||||
import org.kohsuke.stapler.DataBoundConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DropboxPublisher extends BapPublisher<DropboxTransfer> implements Describable<DropboxPublisher> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@DataBoundConstructor
|
||||
public DropboxPublisher(final String configName, final boolean verbose, final ArrayList<DropboxTransfer> transfers,
|
||||
final boolean useWorkspaceInPromotion, final boolean usePromotionTimestamp, final DropboxRetry retry,
|
||||
final DropboxPublisherLabel label) {
|
||||
super(configName, verbose, transfers, useWorkspaceInPromotion, usePromotionTimestamp, retry, label, null);
|
||||
}
|
||||
|
||||
public DropboxRetry getRetry() {
|
||||
return (DropboxRetry) super.getRetry();
|
||||
}
|
||||
|
||||
public DropboxPublisherLabel getLabel() {
|
||||
return (DropboxPublisherLabel) super.getLabel();
|
||||
}
|
||||
|
||||
public OneDrivePublisherDescriptor getDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(OneDrivePublisherDescriptor.class);
|
||||
}
|
||||
|
||||
public boolean equals(final Object that) {
|
||||
if (this == that) return true;
|
||||
if (that == null || getClass() != that.getClass()) return false;
|
||||
|
||||
return addToEquals(new EqualsBuilder(), (DropboxPublisher) that).isEquals();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return addToHashCode(new HashCodeBuilder()).toHashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.impl;
|
||||
|
||||
import hudson.Extension;
|
||||
import hudson.model.Describable;
|
||||
import hudson.model.Descriptor;
|
||||
import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.publish_over.PublisherLabel;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringStyle;
|
||||
import org.kohsuke.stapler.DataBoundConstructor;
|
||||
|
||||
public class DropboxPublisherLabel extends PublisherLabel implements Describable<DropboxPublisherLabel> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@DataBoundConstructor
|
||||
public DropboxPublisherLabel(final String label) {
|
||||
super(label);
|
||||
}
|
||||
|
||||
public DropboxPublisherLabelDescriptor getDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(DropboxPublisherLabelDescriptor.class);
|
||||
}
|
||||
|
||||
public boolean equals(final Object that) {
|
||||
if (this == that) return true;
|
||||
if (that == null || getClass() != that.getClass()) return false;
|
||||
|
||||
return addToEquals(new EqualsBuilder(), (DropboxPublisherLabel) that).isEquals();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return addToHashCode(new HashCodeBuilder()).toHashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
|
||||
}
|
||||
|
||||
@Extension
|
||||
public static class DropboxPublisherLabelDescriptor extends Descriptor<DropboxPublisherLabel> {
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return Messages.publisherLabel_descriptor();
|
||||
}
|
||||
|
||||
public jenkins.plugins.publish_over.view_defaults.PublisherLabel.Messages getCommonFieldNames() {
|
||||
return new jenkins.plugins.publish_over.view_defaults.PublisherLabel.Messages();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.impl;
|
||||
|
||||
import hudson.Extension;
|
||||
import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.publish_over.BPPlugin;
|
||||
import jenkins.plugins.publish_over.BPPluginDescriptor;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringStyle;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.descriptor.OneDrivePublisherPluginDescriptor;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.OneDriveClient;
|
||||
import org.kohsuke.stapler.DataBoundConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DropboxPublisherPlugin extends BPPlugin<DropboxPublisher, OneDriveClient, Object> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@DataBoundConstructor
|
||||
public DropboxPublisherPlugin(final ArrayList<DropboxPublisher> publishers, final boolean continueOnError, final boolean failOnError,
|
||||
final boolean alwaysPublishFromMaster, final String masterNodeName) {
|
||||
super(Messages.console_message_prefix(), publishers, continueOnError, failOnError, alwaysPublishFromMaster, masterNodeName,
|
||||
null);
|
||||
}
|
||||
|
||||
public boolean equals(final Object that) {
|
||||
if (this == that) return true;
|
||||
if (that == null || getClass() != that.getClass()) return false;
|
||||
|
||||
return addToEquals(new EqualsBuilder(), (DropboxPublisherPlugin) that).isEquals();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return addToHashCode(new HashCodeBuilder()).toHashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Descriptor getDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(Descriptor.class);
|
||||
}
|
||||
|
||||
public DropboxHostConfiguration getConfiguration(final String name) {
|
||||
return getDescriptor().getConfiguration(name);
|
||||
}
|
||||
|
||||
@Extension
|
||||
public static class Descriptor extends OneDrivePublisherPluginDescriptor {
|
||||
}
|
||||
|
||||
/**
|
||||
* left in to prevent xstream noise
|
||||
*/
|
||||
@Deprecated
|
||||
public static class DescriptorMessages implements BPPluginDescriptor.BPDescriptorMessages {
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.impl;
|
||||
|
||||
import hudson.Extension;
|
||||
import hudson.model.Describable;
|
||||
import hudson.model.Descriptor;
|
||||
import hudson.util.FormValidation;
|
||||
import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.publish_over.Retry;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringStyle;
|
||||
import org.kohsuke.stapler.DataBoundConstructor;
|
||||
import org.kohsuke.stapler.QueryParameter;
|
||||
|
||||
public class DropboxRetry extends Retry implements Describable<DropboxRetry> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@DataBoundConstructor
|
||||
public DropboxRetry(final int retries, final long retryDelay) {
|
||||
super(retries, retryDelay);
|
||||
}
|
||||
|
||||
public DropboxRetryDescriptor getDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(DropboxRetryDescriptor.class);
|
||||
}
|
||||
|
||||
public boolean equals(final Object that) {
|
||||
if (this == that) return true;
|
||||
if (that == null || getClass() != that.getClass()) return false;
|
||||
|
||||
return addToEquals(new EqualsBuilder(), (DropboxRetry) that).isEquals();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return addToHashCode(new HashCodeBuilder()).toHashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
|
||||
}
|
||||
|
||||
@Extension
|
||||
public static class DropboxRetryDescriptor extends Descriptor<DropboxRetry> {
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return Messages.retry_descriptor();
|
||||
}
|
||||
|
||||
public FormValidation doCheckRetries(@QueryParameter final String value) {
|
||||
return FormValidation.validateNonNegativeInteger(value);
|
||||
}
|
||||
|
||||
public FormValidation doCheckRetryDelay(@QueryParameter final String value) {
|
||||
return FormValidation.validatePositiveInteger(value);
|
||||
}
|
||||
|
||||
public jenkins.plugins.publish_over.view_defaults.Retry.Messages getCommonFieldNames() {
|
||||
return new jenkins.plugins.publish_over.view_defaults.Retry.Messages();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.impl;
|
||||
|
||||
import com.cloudbees.plugins.credentials.CredentialsScope;
|
||||
import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials;
|
||||
import edu.umd.cs.findbugs.annotations.NonNull;
|
||||
import hudson.Extension;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.OneDriveToken;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.domain.OneDrive;
|
||||
import org.kohsuke.stapler.DataBoundConstructor;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
|
||||
public class DropboxTokenImpl extends BaseStandardCredentials implements OneDriveToken {
|
||||
|
||||
@Nonnull
|
||||
private final String authorizationCode;
|
||||
@Nonnull
|
||||
private final String accessCode;
|
||||
|
||||
@DataBoundConstructor
|
||||
public DropboxTokenImpl(CredentialsScope scope, String id, @Nonnull String authorizationCode, String description) throws IOException {
|
||||
super(scope, id, description);
|
||||
this.authorizationCode = authorizationCode;
|
||||
this.accessCode = OneDrive.convertAuthorizationToAccessCode(authorizationCode);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getAuthorizationCode() {
|
||||
return authorizationCode;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getAccessCode() {
|
||||
return accessCode;
|
||||
}
|
||||
|
||||
@Extension
|
||||
public static class DescriptorImpl extends BaseStandardCredentialsDescriptor {
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return Messages.DropboxTokenImpl_api_token();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (C) 2015 by René de Groot
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package org.jenkinsci.plugins.publishoverdropbox.impl;
|
||||
|
||||
import hudson.model.Describable;
|
||||
import jenkins.model.Jenkins;
|
||||
import jenkins.plugins.publish_over.BPTransfer;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringStyle;
|
||||
import org.jenkinsci.plugins.publishoverdropbox.descriptor.OneDriveTransferDescriptor;
|
||||
import org.kohsuke.stapler.DataBoundConstructor;
|
||||
|
||||
public class DropboxTransfer extends BPTransfer implements Describable<DropboxTransfer> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final boolean pruneRoot;
|
||||
private final int pruneRootDays;
|
||||
|
||||
@DataBoundConstructor
|
||||
public DropboxTransfer(final String sourceFiles, final String excludes, final String remoteDirectory, final String removePrefix, final boolean remoteDirectorySDF, final boolean flatten, final boolean cleanRemote,
|
||||
final boolean pruneRoot, final int pruneRootDays) {
|
||||
super(sourceFiles, excludes, remoteDirectory, removePrefix, remoteDirectorySDF, flatten, cleanRemote, false, false, null);
|
||||
this.pruneRoot = pruneRoot;
|
||||
this.pruneRootDays = pruneRootDays;
|
||||
}
|
||||
|
||||
public int getPruneRootDays() {
|
||||
return pruneRootDays;
|
||||
}
|
||||
|
||||
public boolean isPruneRoot() {
|
||||
return pruneRoot;
|
||||
}
|
||||
|
||||
public static boolean canUseExcludes() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public OneDriveTransferDescriptor getDescriptor() {
|
||||
return Jenkins.getInstance().getDescriptorByType(OneDriveTransferDescriptor.class);
|
||||
}
|
||||
|
||||
protected ToStringBuilder addToToString(final ToStringBuilder builder) {
|
||||
return super.addToToString(builder);
|
||||
}
|
||||
|
||||
public boolean equals(final Object that) {
|
||||
if (this == that) return true;
|
||||
if (that == null || getClass() != that.getClass()) return false;
|
||||
|
||||
return addToEquals(new EqualsBuilder(), (DropboxTransfer) that).isEquals();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return addToHashCode(new HashCodeBuilder()).toHashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return addToToString(new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<?jelly escape-by-default='true'?>
|
||||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
Send build artifacts to a Dropbox account.
|
||||
</div>
|
|
@ -0,0 +1,47 @@
|
|||
<?jelly escape-by-default='true'?>
|
||||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:poj="/pojelly">
|
||||
|
||||
<poj:defaultMessages/>
|
||||
<!-- title="${m.name()}" -->
|
||||
<f:entry title="OneDrive Name" field="name">
|
||||
<f:textbox/>
|
||||
</f:entry>
|
||||
<f:entry title="${%token}" field="token">
|
||||
<f:select/>
|
||||
</f:entry>
|
||||
<f:entry title="${m.remotePath()}" field="remoteRootDir">
|
||||
<f:textbox default="/"/>
|
||||
</f:entry>
|
||||
<f:advanced>
|
||||
<f:entry title="${m.timeout()}" field="timeout">
|
||||
<f:textbox default="${descriptor.defaultTimeout}"/>
|
||||
</f:entry>
|
||||
</f:advanced>
|
||||
<f:validateButton title="${m.test_title()}" progress="${m.test_progress()}" method="testConnection"
|
||||
with="name,token,remoteRootDir,timeout"/>
|
||||
|
||||
</j:jelly>
|
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (C) 2015 by Ren\u00c3\u00a9 de Groot
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
#
|
||||
|
||||
token=OneDrive account
|
|
@ -0,0 +1,25 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>The name of this configuration. This will be appear in the drop down list in the job configuration.</div>
|
|
@ -0,0 +1,30 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>The base directory for this configuration.</p>
|
||||
|
||||
<p>This directory must exist, it will not be created.<br/>
|
||||
The publisher will only be able to place files below this directory.</p>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Timeout in milliseconds for the connection, and when reading data</p>
|
||||
|
||||
<p>Set to zero to disable</p>
|
||||
</div>
|
|
@ -0,0 +1,26 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>The account use to access this location. Retrieved from the Dropbox API tokens in Credentials.
|
||||
</div>
|
|
@ -0,0 +1,84 @@
|
|||
<?jelly escape-by-default='true'?>
|
||||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:poj="/pojelly">
|
||||
|
||||
<poj:defaultMessages/>
|
||||
<br/>
|
||||
<f:entry title="${m.hostconfig()}" field="configName">
|
||||
<select class="setting-input" name="configName">
|
||||
<j:forEach var="s" items="${descriptor.publisherPluginDescriptor.hostConfigurations}">
|
||||
<f:option value="${s.name}"
|
||||
selected="${s.name==instance.configName or ( instance==null and s.name==defaults.publisher.configName ) }">
|
||||
${s.name}
|
||||
</f:option>
|
||||
</j:forEach>
|
||||
</select>
|
||||
</f:entry>
|
||||
<j:if test="${inPromotion}">
|
||||
<j:choose>
|
||||
<j:when test="${it.getClass().canonicalName == 'hudson.matrix.MatrixProject'}">
|
||||
<j:set var="matrixPromotion" value="true"/>
|
||||
<poj:disabled-checkbox field="useWorkspaceInPromotion" title="${m.useWorkspaceInPromotion()}"
|
||||
checked="true" helpField="useWorkspaceInPromotionForMatrix"/>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<f:entry field="useWorkspaceInPromotion">
|
||||
<poj:checkbox title="${m.useWorkspaceInPromotion()}"
|
||||
default="${defaults.publisher.useWorkspaceInPromotion}"/>
|
||||
</f:entry>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
<f:entry field="usePromotionTimestamp">
|
||||
<poj:checkbox title="${m.usePromotionTimestamp()}" default="${defaults.publisher.usePromotionTimestamp}"/>
|
||||
</f:entry>
|
||||
</j:if>
|
||||
|
||||
<f:advanced>
|
||||
<f:entry field="verbose">
|
||||
<poj:checkbox title="${%verbose.title}"/>
|
||||
</f:entry>
|
||||
<f:optionalProperty title="${%retry.title}" field="retry"/>
|
||||
</f:advanced>
|
||||
|
||||
<f:entry title="${m.transfers_section()}">
|
||||
<j:scope>
|
||||
<j:set var="descriptor" value="${descriptor.transferDescriptor}"/>
|
||||
<f:repeatable items="${instance.transfers}" var="instance" name="transfers" minimum="1"
|
||||
header="${m.transfers_dragAndDropLabel()}" add="${m.addTransfer()}">
|
||||
<table width="100%" padding="0">
|
||||
<st:include page="config.jelly" class="${descriptor.clazz}"/>
|
||||
<f:entry title="">
|
||||
<div align="right" class="show-if-not-only">
|
||||
<f:repeatableDeleteButton value="${m.deleteTransfer()}"/>
|
||||
</div>
|
||||
</f:entry>
|
||||
</table>
|
||||
</f:repeatable>
|
||||
</j:scope>
|
||||
</f:entry>
|
||||
|
||||
|
||||
</j:jelly>
|
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (C) 2015 by René de Groot
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
#
|
||||
|
||||
hostconfig.title=Name
|
||||
useWorkspaceInPromotion.title=Use the workspace
|
||||
usePromotionTimestamp.title=Use promotion timestamp
|
||||
transfers.section=Transfers
|
||||
transfers.dragAndDropLabel=Transfer Set
|
||||
addTransfer.value=Add Transfer Set
|
||||
deleteTransfer.value=Delete Transfer Set
|
||||
verbose.title=Verbose output in console
|
||||
retry.title=Retry
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Select an Dropbox account from the list configured in the global configuration of this Jenkins.</p>
|
||||
|
||||
<p>The configuration defines the connection properties and base directory of the Dropbox publication.</p>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>If publishing to this server fails, try again.</p>
|
||||
<p>Files that were successfully transferred will not be re-sent.<br>
|
||||
If the <em>Clean remote</em> option is selected, and succeeds, it will not be attempted again.</p>
|
||||
</div>
|
|
@ -0,0 +1,30 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Use the build time of the promotion when the remote directory is a date format</p>
|
||||
<p>By default this plugin uses the time of the original build (the one that is being promoted) when formatting the
|
||||
remote directory. Setting this option will mean that if you use the remote directory is a date format option,
|
||||
it will use the time that the promotion process runs, instead of the original build.</p>
|
||||
</div>
|
|
@ -0,0 +1,41 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Set the root directory for the Source files to the workspace</p>
|
||||
|
||||
<p>By default this plugin uses the artifacts directory (where archived artifacts are stored). This allows the
|
||||
artifacts
|
||||
from the build number that you are promoting to be sent somewhere else.</p>
|
||||
|
||||
<p>If you run tasks that produce files in the workspace during the promotion and you want to publish them, then set
|
||||
this
|
||||
option.</p>
|
||||
|
||||
<p>If you need to send files from both the workspace and the archive directory, then you need to add a second
|
||||
server,
|
||||
even if you want to send the files to the same place. This is due to the fact that the workspace is not
|
||||
necessarily
|
||||
on the same host as the archive directory</p>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Matrix jobs will always use the workspace as the base directory for Source files - even in promotions</p>
|
||||
|
||||
<p>The promotion process will only run once and the build artifacts are stored beneath each configuration.</p>
|
||||
</div>
|
|
@ -0,0 +1,27 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>Select to enable logging of all commands sent to, and responses received from the Dropbox server in the Jenkins
|
||||
console.
|
||||
</div>
|
|
@ -0,0 +1,71 @@
|
|||
<?jelly escape-by-default='true'?>
|
||||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:poj="/pojelly">
|
||||
|
||||
<j:set var="defaults" value="${descriptor.defaults}"/>
|
||||
|
||||
<poj:defaultMessages/>
|
||||
|
||||
<j:set var="plugin" value="${instance}"/>
|
||||
<j:set var="instance" value="${instance.delegate}"/>
|
||||
<f:entry title='${inPromotion ? "" : "%publishers.section"}'>
|
||||
<j:scope>
|
||||
<j:set var="descriptor" value="${descriptor.publisherDescriptor}"/>
|
||||
<f:repeatable items="${instance.publishers}" var="instance" name="publishers" minimum="1"
|
||||
header="${%publisher.dragAndDropLabel}" add="${%publisher.addDropboxAccount}">
|
||||
<table width="100%" padding="0">
|
||||
<st:include page="config.jelly" class="${descriptor.clazz}"/>
|
||||
<f:entry title="">
|
||||
<div align="right" class="show-if-not-only">
|
||||
<f:repeatableDeleteButton value="${%publisher.deletePublisher}"/>
|
||||
</div>
|
||||
</f:entry>
|
||||
</table>
|
||||
</f:repeatable>
|
||||
</j:scope>
|
||||
|
||||
<f:advanced>
|
||||
<f:entry field="continueOnError">
|
||||
<poj:checkbox title="${%continueOnError}" default="${defaults.instanceConfig.continueOnError}"/>
|
||||
</f:entry>
|
||||
<f:entry field="failOnError">
|
||||
<poj:checkbox title="${m.failOnError()}" default="${defaults.instanceConfig.failOnError}"/>
|
||||
</f:entry>
|
||||
<f:entry field="alwaysPublishFromMaster">
|
||||
<poj:checkbox title="${%alwaysPublishFromMaster}"
|
||||
default="${defaults.instanceConfig.alwaysPublishFromMaster}"/>
|
||||
</f:entry>
|
||||
<j:if test="${descriptor.canSetMasterNodeName()}">
|
||||
<f:entry title="${m.masterNodeName()}" field="masterNodeName">
|
||||
<f:textbox default="${descriptor.defaultMasterNodeName}"/>
|
||||
</f:entry>
|
||||
</j:if>
|
||||
</f:advanced>
|
||||
|
||||
</f:entry>
|
||||
|
||||
|
||||
</j:jelly>
|
|
@ -0,0 +1,30 @@
|
|||
#
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (C) 2015 by Ren\u00c3\u00a9 de Groot
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
#
|
||||
|
||||
publishers.section=OneDrive Publishers
|
||||
publisher.dragAndDropLabel=OneDrive account
|
||||
publisher.addDropboxAccount=Add Account
|
||||
publisher.deletePublisher=Remove Account
|
||||
continueOnError=Publish to other OneDrive accounts if an error occurs
|
||||
alwaysPublishFromMaster=Always connect to OneDrive from master
|
|
@ -0,0 +1,48 @@
|
|||
<?jelly escape-by-default='true'?>
|
||||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
|
||||
|
||||
<j:set var="m" value="${descriptor.commonManageMessages}"/>
|
||||
|
||||
<f:section title="${%hostconfig.section.title}" description="${%hostconfig.section.description}">
|
||||
<f:entry title="${%hostconfig.entry.title}">
|
||||
<j:scope>
|
||||
<j:set var="descriptor" value="${descriptor.hostConfigurationDescriptor}"/>
|
||||
<f:repeatable var="instance" items="${instance.hostConfigurations}" header="${%hostconfig.dragAndDrop}">
|
||||
<table width="100%">
|
||||
<st:include page="config.jelly" class="${descriptor.clazz}"/>
|
||||
<f:entry title="">
|
||||
<div align="right">
|
||||
<f:repeatableDeleteButton/>
|
||||
</div>
|
||||
</f:entry>
|
||||
</table>
|
||||
</f:repeatable>
|
||||
</j:scope>
|
||||
</f:entry>
|
||||
</f:section>
|
||||
|
||||
</j:jelly>
|
|
@ -0,0 +1,28 @@
|
|||
#
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (C) 2015 by Ren\u00c3\u00a9 de Groot
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
#
|
||||
|
||||
hostconfig.section.title=OneDrive
|
||||
hostconfig.section.description=A configuration to use to connect to a OneDrive location
|
||||
hostconfig.entry.title=OneDrive locations
|
||||
hostconfig.dragAndDrop=OneDrive location
|
|
@ -0,0 +1,34 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Select to publish from the Jenkins master.</p>
|
||||
|
||||
<p>The default is to publish from the server that holds the files to transfer (workspace on the slave, or artifacts
|
||||
directory on the master)<br/>
|
||||
Enabling this option could help dealing with strict network configurations and firewall rules.<br/>
|
||||
This option will cause the files to be transferred through the master before being sent to the remote server,
|
||||
this may
|
||||
increase network traffic, and could increase the build time.</p>
|
||||
</div>
|
|
@ -0,0 +1,26 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>Select to continue publishing to the other Dropbox accounts after a problem with a previous account</div>
|
|
@ -0,0 +1,28 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>Select to mark the build as a failure if there is a problem publishing to an account. The default is to mark the
|
||||
build as unstable
|
||||
</div>
|
|
@ -0,0 +1,32 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Set the NODE_NAME for the master Jenkins.</p>
|
||||
|
||||
<p>Set this option to give a value to the NODE_NAME environment variable when the value is missing (the Jenkins
|
||||
master).<br/>
|
||||
This is useful if you use the $NODE_NAME variable in the remoteDirectory
|
||||
option and the build may occur on the master.</p>
|
||||
</div>
|
|
@ -0,0 +1,25 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>Send build artifacts to a Dropbox account</div>
|
|
@ -0,0 +1,35 @@
|
|||
<?jelly escape-by-default='true'?>
|
||||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
|
||||
|
||||
<f:entry title="${%retries.title}" field="retries">
|
||||
<f:textbox default="${descriptor.defaultRetries}"/>
|
||||
</f:entry>
|
||||
<f:entry title="${%retryDelay.title}" field="retryDelay">
|
||||
<f:textbox default="${descriptor.defaultRetryDelay}"/>
|
||||
</f:entry>
|
||||
|
||||
</j:jelly>
|
|
@ -0,0 +1,26 @@
|
|||
#
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (C) 2015 by René de Groot
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
#
|
||||
|
||||
retries.title=Retries
|
||||
retryDelay.title=Delay
|
|
@ -0,0 +1,25 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>The number of times to retry this server in the event of failure</div>
|
|
@ -0,0 +1,25 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>The time to wait, in milliseconds, before attempting another transfer</div>
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<?jelly escape-by-default='true'?>
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler">
|
||||
|
||||
<j:invokeStatic className="org.jenkinsci.plugins.publishoverdropbox.domain.Config" method="getAuthorizeUrl"
|
||||
var="url"/>
|
||||
|
||||
<f:entry title="${%Token}" field="authorizationCode">
|
||||
<f:textbox/>
|
||||
|
||||
|
||||
The API token can be
|
||||
<a href="${url}"
|
||||
target="_blank">generated
|
||||
</a>
|
||||
on the OneDrive website.
|
||||
</f:entry>
|
||||
<st:include page="id-and-description" class="${descriptor.clazz}"/>
|
||||
</j:jelly>
|
|
@ -0,0 +1,27 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
<div>
|
||||
A Dropbox OAuth 2.0 auth token that gives access to upload files to a authorized account. Click on the generate
|
||||
token link to create a token on the Dropbox website. Copy the generated token in the field.
|
||||
</div>
|
|
@ -0,0 +1,88 @@
|
|||
<?jelly escape-by-default='true'?>
|
||||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
|
||||
|
||||
<!--
|
||||
<f:entry title="Path to local file" field="filePath">
|
||||
<f:textbox/>
|
||||
</f:entry>
|
||||
|
||||
<f:description>
|
||||
<j:out value='(Ex. /Users/Documents/Debian_Iso.iso)'/>
|
||||
</f:description>
|
||||
|
||||
<f:entry title="${%remoteDirectory.title}" field="remoteDirectory">
|
||||
<f:textbox default="/"/>
|
||||
</f:entry>
|
||||
|
||||
<f:description>
|
||||
<j:out value='Default path is set to root (/)'/>
|
||||
</f:description>
|
||||
-->
|
||||
|
||||
<f:entry title="${%sourceFiles.title}" field="sourceFiles"
|
||||
help="${descriptor.getHelpFile((inPromotion and !matrixPromotion) ? 'sourceFilesForPromotion' : 'sourceFiles')}">
|
||||
<f:textbox />
|
||||
</f:entry>
|
||||
|
||||
<f:entry title="${%removePrefix.title}" field="removePrefix">
|
||||
<f:textbox/>
|
||||
</f:entry>
|
||||
|
||||
<f:description>
|
||||
<j:out value='${%transfers.envVars(rootURL)}'/>
|
||||
</f:description>
|
||||
|
||||
<f:advanced>
|
||||
|
||||
<j:if test="${descriptor.canUseExcludes()}">
|
||||
<f:entry title="${%excludes.title}" field="excludes">
|
||||
<f:textbox/>
|
||||
</f:entry>
|
||||
</j:if>
|
||||
|
||||
<f:entry title="${%flatten.title}" field="flatten">
|
||||
<f:checkbox/>
|
||||
</f:entry>
|
||||
|
||||
<f:entry title="${%cleanRemote.title}" field="cleanRemote">
|
||||
<f:checkbox/>
|
||||
</f:entry>
|
||||
|
||||
<f:block>
|
||||
<f:optionalBlock title="${%remoteDirectorySDF.title}" field="remoteDirectorySDF" inline="true">
|
||||
<f:optionalBlock title="${%pruneRoot.title}" field="pruneRoot" inline="true">
|
||||
<f:entry title="${%pruneDays.title}">
|
||||
<f:textbox default="31" field="pruneRootDays"/>
|
||||
</f:entry>
|
||||
</f:optionalBlock>
|
||||
</f:optionalBlock>
|
||||
</f:block>
|
||||
|
||||
|
||||
</f:advanced>
|
||||
|
||||
</j:jelly>
|
|
@ -0,0 +1,35 @@
|
|||
#
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (C) 2015 by Ren\u00c3\u00a9 de Groot
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
#
|
||||
|
||||
sourceFiles.title=Source files
|
||||
removePrefix.title=Remove prefix
|
||||
remoteDirectory.title=OneDrive directory
|
||||
excludes.title=Exclude files
|
||||
flatten.title=Flatten files
|
||||
remoteDirectorySDF.title=Remote directory is a date format
|
||||
cleanRemote.title=Clean remote
|
||||
transfers.envVars=All of the transfer fields support substitution of \
|
||||
<a href="{0}/env-vars.html" target="_blank">Jenkins environment variables</a>
|
||||
pruneRoot.title=Remove old directories in remote root
|
||||
pruneDays.title=Max days
|
|
@ -0,0 +1,27 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Select to delete all files and directories within the remote directory before transferring files.</p>
|
||||
</div>
|
|
@ -0,0 +1,31 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Exclude files from the Transfer set.</p>
|
||||
|
||||
<p>The string is a comma separated list of excludes for an Ant fileset eg. '**/*.log,**/*.tmp,.git/'
|
||||
(see <a href="http://ant.apache.org/manual/dirtasks.html#patterns">Patterns</a> in the Ant manual)
|
||||
</p>
|
||||
</div>
|
|
@ -0,0 +1,31 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Only create files on the server, don't create directories (except for the remote directory, if present)</p>
|
||||
|
||||
<p><strong>All files that have been selected to transfer must have unique filenames.</strong> The publisher will
|
||||
stop and fail as
|
||||
soon as a duplicate filename is found when using the flatten option.</p>
|
||||
</div>
|
|
@ -0,0 +1,30 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2015 by René de Groot
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>A date format directory format can lead to a long list of directories. Removing old directories in the remote
|
||||
root will allow you to prune that list.</p>
|
||||
|
||||
<p>Directories older then the max days will be deleted.</p>
|
||||
</div>
|
|
@ -0,0 +1,30 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Optional destination folder.</p>
|
||||
|
||||
<p>This folder will be below the one in the global configuration, if present.<br/>
|
||||
The folder will be created if does not exist.</p>
|
||||
</div>
|
|
@ -0,0 +1,63 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Select this to include the timestamp in the remote directory.</p>
|
||||
|
||||
<p>The timestamp is the date of build. If this publisher is being used during a promotion, then the timestamp is
|
||||
that of the build that is being promoted.
|
||||
<br/>This setting turns the remote directory option into a java SimpleDateFormat.
|
||||
<br/>The SimpleDateFormat(SDF) uses letters to represent components of the date, like the month, year, or day of
|
||||
the week. <a href="http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html">Click here for
|
||||
more information about the date patterns.</a>
|
||||
<br/>As the SDF reserves all of the letters [A-Z][a-z], any that you want to appear literally in the directory
|
||||
that is created will need to be quoted.</p>
|
||||
|
||||
<p>Some examples follow - all examples are based on a build with a timestamp of 3:45 pm and 55 seconds on the 7th
|
||||
November 2010.
|
||||
<br/>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Remote directory</th>
|
||||
<th>Directories created</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>'qa-approved/'yyyyMMddHHmmss</code></td>
|
||||
<td><code>qa-approved/20101107154555</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>'builds/'yyyy/MM/dd/'build-${BUILD_NUMBER}'</code></td>
|
||||
<td><code>builds/2010/11/07/build-456</code> (if the build was number 456)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>yyyy_MM/'build'-EEE-d-HHmmss</code></td>
|
||||
<td><code>2010_11/build-Sun-7-154555</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>yyyy-MM-dd_HH-mm-ss</code></td>
|
||||
<td><code>2010-11-07_15-45-55</code></td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
</div>
|
|
@ -0,0 +1,36 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>First part of the file path that should not be created on the remote server.</p>
|
||||
|
||||
<p>Directory structures are created relative to the base directory, which is usually the workspace.<br/>
|
||||
You normally do not want the full path to these files to be created on the server.<br/>
|
||||
For example if Source files were <code>target/deployment/images/**/</code> then you may want Remove prefix to be
|
||||
<code>target/deployment</code> This would create the images folder under the remote directory, and not
|
||||
target/deployment<br/>
|
||||
Jenkins environment variables can be used in this path.</p>
|
||||
|
||||
<p><strong>If you use remove prefix, then ALL source file paths MUST start with the prefix.</strong></p>
|
||||
</div>
|
|
@ -0,0 +1,32 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Files to upload to a server.</p>
|
||||
|
||||
<p>The string is a comma separated list of includes for an Ant fileset eg. '**/*.jar'
|
||||
(see <a href="http://ant.apache.org/manual/dirtasks.html#patterns">Patterns</a> in the Ant manual).<br/>
|
||||
The base directory for this fileset is the workspace.
|
||||
</p>
|
||||
</div>
|
|
@ -0,0 +1,35 @@
|
|||
<!--
|
||||
~ The MIT License
|
||||
~
|
||||
~ Copyright (C) 2010-2011 by Anthony Robinson
|
||||
~
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ The above copyright notice and this permission notice shall be included in
|
||||
~ all copies or substantial portions of the Software.
|
||||
~
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
~ THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<div>
|
||||
<p>Files to upload to a server.</p>
|
||||
|
||||
<p>The string is a comma separated list of includes for an Ant fileset eg. '**/*.jar'
|
||||
(see <a href="http://ant.apache.org/manual/dirtasks.html#patterns">Patterns</a> in the Ant manual).<br/>
|
||||
The base directory for this fileset is the artifacts directory of the build that is being promoted. Ensure that
|
||||
you
|
||||
"Archive the artifacts" in the Post-build Actions to make your artifacts available during a promotion<br/>
|
||||
Change the base directory to the workspace by setting the "Use the workspace" checkbox.
|
||||
</p>
|
||||
</div>
|
|
@ -0,0 +1,58 @@
|
|||
#
|
||||
# The MIT License
|
||||
#
|
||||
# Copyright (C) 2015 by Ren\u00c3\u00a9 de Groot
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
#
|
||||
|
||||
DropboxTokenImpl.api_token=OneDrive API token
|
||||
descriptor.displayName=Send build artifacts over OneDrive
|
||||
|
||||
hostconfig.descriptor=OneDrive Account Configuration
|
||||
hostconfig.formvalidation.root=Remote directory must be an absolute path. (Starting with a '/')
|
||||
publisher.descriptor=OneDrive Publisher
|
||||
transfer.descriptor=OneDrive Transfer
|
||||
retry.descriptor=OneDrive Retry
|
||||
publisherLabel.descriptor=OneDrive Publisher Label
|
||||
|
||||
exception.dropbox.url=Failed to build URL to create a connection
|
||||
exception.dropbox.folder=Failed GET Folder on {0}
|
||||
exception.dropbox.delete=Failed to delete file or folder
|
||||
exception.dropbox.deleteIsNotFolder=Path does not contain a folder to clear
|
||||
exception.dropbox.body=Failed to encode body
|
||||
|
||||
exception.rest.connection=Failed to open connection to server
|
||||
exception.rest.model=Failed to create response model
|
||||
exception.rest.http=HTTP {0} error {1} {2}
|
||||
|
||||
exception.bap.createclient=Failed to connect and initialize Dropbox connection. Message: {0}
|
||||
exception.bap.logInFailed=Failed to log in with username {0} - check username and password
|
||||
|
||||
exception.noSourceFiles=A Transfer Set must contain Source files - if you really want to include everything, set Source files to **/* or **\\*
|
||||
exception.exceptionOnDisconnect=Exception when disconnecting from server. Message {0}
|
||||
exception.cwdException=Exception when changing to Dropbox directory {0}
|
||||
exception.failedToStoreFile=Could not write file. Server message: {0}
|
||||
exception.mkdirException=Exception when creating Dropbox directory {0}
|
||||
|
||||
console.message.prefix=OneDrive:
|
||||
log.disconnectQuietly=Exception disconnecting
|
||||
|
||||
form.testConnection.ok=Success
|
||||
form.testConnection.error=Failed to connect or change directory
|
Загрузка…
Ссылка в новой задаче