├── sample ├── site │ ├── archives │ │ └── sample.apk │ ├── index.html │ └── doc │ │ └── userguide.html ├── my-mime.types ├── jets3t.properties └── build.gradle ├── docs └── no-java-source ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src ├── main │ ├── resources │ │ ├── META-INF │ │ │ └── gradle-plugins │ │ │ │ └── com.monochromeroad.s3sync.properties │ │ ├── default.jets3t.properties │ │ └── mime.types │ └── groovy │ │ └── com │ │ └── monochromeroad │ │ └── gradle │ │ └── plugin │ │ └── aws │ │ └── s3 │ │ ├── S3SyncPlugin.groovy │ │ ├── ACL.groovy │ │ ├── ReportLevel.groovy │ │ └── S3Sync.groovy └── test │ ├── groovy │ └── com │ │ └── monochromeroad │ │ └── gradle │ │ └── plugin │ │ └── aws │ │ └── s3 │ │ └── S3SyncSpec.groovy │ └── resources │ └── default.jets3t.properties ├── .travis.yml ├── gradlew.bat ├── gradlew └── README.md /sample/site/archives/sample.apk: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/no-java-source: -------------------------------------------------------------------------------- 1 | There is no java source in the project. 2 | -------------------------------------------------------------------------------- /sample/my-mime.types: -------------------------------------------------------------------------------- 1 | application/vnd.android.package-archive apk 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .cache/ 3 | .gradle/ 4 | libs/ 5 | build/ 6 | *.iml 7 | 8 | sample/*.bat 9 | 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/literalice/gradle-aws-s3-sync/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/META-INF/gradle-plugins/com.monochromeroad.s3sync.properties: -------------------------------------------------------------------------------- 1 | implementation-class=com.monochromeroad.gradle.plugin.aws.s3.S3SyncPlugin 2 | -------------------------------------------------------------------------------- /sample/site/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TOP 6 | 7 | 8 |

TOP

9 |

TOP Page

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Apr 09 15:45:00 JST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip 7 | -------------------------------------------------------------------------------- /sample/site/doc/userguide.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | User Guide 6 | 7 | 8 |

USER GUIDE

9 |

10 | This is the User Guide. 11 |

12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/groovy/com/monochromeroad/gradle/plugin/aws/s3/S3SyncPlugin.groovy: -------------------------------------------------------------------------------- 1 | package com.monochromeroad.gradle.plugin.aws.s3 2 | 3 | import org.gradle.api.Plugin 4 | import org.gradle.api.Project 5 | 6 | /** 7 | * The plugin class for S3 sync 8 | */ 9 | class S3SyncPlugin implements Plugin { 10 | 11 | @Override 12 | void apply(Project project) { 13 | 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /sample/jets3t.properties: -------------------------------------------------------------------------------- 1 | s3service.default-bucket-location=Tokyo 2 | # httpclient.max-connections=2 3 | # threaded-service.admin-max-thread-count=5 4 | 5 | ### 6 | # File/Object comparison properties 7 | ### 8 | 9 | filecomparer.skip-symlinks=true 10 | filecomparer.use-md5-files=true 11 | filecomparer.generate-md5-files=true 12 | filecomparer.md5-files-root-dir=.cache 13 | filecomparer.skip-upload-of-md5-files=true 14 | #filecomparer.assume-local-latest-in-mismatch=false 15 | 16 | -------------------------------------------------------------------------------- /src/main/groovy/com/monochromeroad/gradle/plugin/aws/s3/ACL.groovy: -------------------------------------------------------------------------------- 1 | package com.monochromeroad.gradle.plugin.aws.s3 2 | 3 | /** 4 | * Access Control List (ACL) for Amazon S3 5 | * 6 | * @author Masatoshi Hayashi 7 | */ 8 | public enum ACL { 9 | 10 | PublicRead("PUBLIC_READ"), 11 | 12 | PublicReadWrite("PUBLIC_READ_WRITE"), 13 | 14 | Private("PRIVATE"); 15 | 16 | private string 17 | 18 | private ACL(String aclString) { 19 | this.string = aclString 20 | } 21 | 22 | String toString() { 23 | return string; 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/main/groovy/com/monochromeroad/gradle/plugin/aws/s3/ReportLevel.groovy: -------------------------------------------------------------------------------- 1 | package com.monochromeroad.gradle.plugin.aws.s3 2 | 3 | /** 4 | * Options for how much report information will be printed. 5 | * 6 | * @author Masatoshi Hayashi 7 | */ 8 | public enum ReportLevel { 9 | 10 | /** no report items will be printed (the summary will still be printed) */ 11 | None(0), 12 | 13 | /** only actions are reported */ 14 | Actions(1), 15 | 16 | /** differences & actions are reported */ 17 | Differences(2), 18 | 19 | /** all items are reported */ 20 | All(3); 21 | 22 | private Integer level; 23 | 24 | private ReportLevel(int level) { 25 | this.level = level 26 | } 27 | 28 | public Integer getLevel() { 29 | return level 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | global: 3 | - BINTRAY_USER=literalice 4 | - secure: "EK552JF3vmKvrESflkPNHnMq4J3yHlWM3/7uK3UeQ/mfSj95haW5Mso0qeDdnqB9Ei5sLcmRnyX7O7Zc4LVmGSGsix4Cv845AgFYezhGByK7UhuO3D1j/wDnXMAdRclgA1Gk37REw0/Suf1FzcEz0JJHxik72CSiSliYfMtKaQ0=" 5 | - secure: "c5vIE3G2giAX0Yw/7bK4kV0MFpeaoVFEisFSNx/lcNK4ebMNjbIAyd++q3RM5ZNOy8XG7W+hGScSXTc/ayN2w5+x/GXmXfL+W2zFua1lhAIXUoGrBwXhEnAUZMQ8zDp2tk2eI1JE6efWV2cL2cvguNJ1pL67cP0KHFGWp2liBI0=" 6 | sudo: false 7 | cache: 8 | directories: 9 | - $HOME/.gradle 10 | 11 | language: java 12 | jdk: 13 | - oraclejdk8 14 | 15 | after_success: 16 | - if [ "${TRAVIS_BRANCH}" = "release" -a "${TRAVIS_PULL_REQUEST}" = "false" ]; then ./gradlew -PbintrayUser=${BINTRAY_USER} -PbintrayKey=${BINTRAY_KEY} -PbintraySignPassphrase=${LITERALICE_GPG_PASSPHRASE} clean bintrayUpload bintraySign ;fi 17 | 18 | -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenLocal() 4 | jcenter() 5 | } 6 | dependencies { 7 | classpath "com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:0.11-SNAPSHOT" 8 | } 9 | } 10 | 11 | import com.monochromeroad.gradle.plugin.aws.s3.S3Sync 12 | 13 | ext { 14 | aws = [accessKey: awsAccessKey, secretKey: awsSecretKey] 15 | } 16 | 17 | task deploy(type: S3Sync){ 18 | description = "Deploys the document on the site." 19 | 20 | accessKey aws.accessKey 21 | secretKey aws.secretKey 22 | 23 | configFile "jets3t.properties" 24 | mimeTypesFile "my-mime.types" 25 | acl com.monochromeroad.gradle.plugin.aws.s3.ACL.PublicRead 26 | 27 | from "site/" 28 | into "gradle-ja" 29 | } 30 | 31 | task download(type: S3Sync) { 32 | description = "Download the document to local." 33 | 34 | accessKey aws.accessKey 35 | secretKey aws.secretKey 36 | 37 | action = 'DOWN' 38 | 39 | from "gradle-ja" 40 | into "$rootDir/build/site" 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/test/groovy/com/monochromeroad/gradle/plugin/aws/s3/S3SyncSpec.groovy: -------------------------------------------------------------------------------- 1 | package com.monochromeroad.gradle.plugin.aws.s3 2 | 3 | import org.gradle.testfixtures.ProjectBuilder 4 | import org.gradle.api.Project 5 | import spock.lang.Specification 6 | 7 | /** 8 | * @author Masatoshi Hayashi 9 | */ 10 | class S3SyncSpec extends Specification { 11 | 12 | def "Loads the jets3t properties"() { 13 | Project project = ProjectBuilder.builder().withProjectDir(new File("sample")).build() 14 | def syncTask = project.task("sync", type: S3Sync) { 15 | configFile "jets3t.properties" 16 | 17 | accessKey = "dummy key" 18 | secretKey = "dummy sec key" 19 | } 20 | 21 | when: 22 | def prop = syncTask.jets3tProperties 23 | 24 | then: 25 | prop.getStringProperty("s3service.default-bucket-location", "default") == "Tokyo" 26 | } 27 | 28 | def "without a jets3t properties"() { 29 | Project project = ProjectBuilder.builder().withProjectDir(new File("sample")).build() 30 | def syncTask = project.task("syncWithDefaultProperties", type: S3Sync) { 31 | accessKey = "dummy key" 32 | secretKey = "dummy sec key" 33 | } 34 | 35 | when: 36 | def prop = syncTask.jets3tProperties 37 | 38 | then: 39 | prop.getStringProperty("s3service.default-bucket-location", "default") == "US" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /src/main/resources/default.jets3t.properties: -------------------------------------------------------------------------------- 1 | ######################### 2 | # Low-level configuration of jets3t toolkit behaviour. 3 | # 4 | # For detailed documentation, please see: 5 | # http://www.jets3t.org/toolkit/configuration.html 6 | # 7 | # Properties set in this file will affect services and applications 8 | # using the JetS3t library. 9 | ######################### 10 | 11 | 12 | ### 13 | # StorageService (apply to both S3 and Google Storage services) 14 | ### 15 | storage-service.internal-error-retry-max=5 16 | storage-service.disable-live-md5=false 17 | #storage-service.apply-recommended-dns-caching-defaults=true 18 | 19 | ### 20 | # ThreadedStorageService (multi-threaded wrapper for S3 or Google services) 21 | ### 22 | threaded-service.max-thread-count=2 23 | threaded-service.admin-max-thread-count=20 24 | threaded-service.ignore-exceptions-in-multi=false 25 | 26 | 27 | ### 28 | # S3ServiceMulti *DEPRECATED* (multi-threaded wrapper for S3 service) 29 | ### 30 | s3service.max-thread-count=2 31 | s3service.admin-max-thread-count=20 32 | s3service.ignore-exceptions-in-multi=false 33 | 34 | 35 | ### 36 | # RestS3Service 37 | ### 38 | s3service.https-only=true 39 | 40 | s3service.s3-endpoint=s3.amazonaws.com 41 | s3service.s3-endpoint-http-port=80 42 | s3service.s3-endpoint-https-port=443 43 | s3service.disable-dns-buckets=false 44 | 45 | s3service.default-bucket-location=US 46 | 47 | s3service.enable-storage-classes=true 48 | s3service.default-storage-class=STANDARD 49 | #s3service.default-storage-class=REDUCED_REDUNDANCY 50 | 51 | # Uncomment this directive to use Amazon S3's server-side encryption 52 | #s3service.server-side-encryption=AES256 53 | 54 | # Virtual path for non-standard servers, such as Eucalyptus 55 | #s3service.s3-endpoint-virtual-path=/services/Walrus 56 | 57 | 58 | ### 59 | # GoogleStorageService 60 | ### 61 | gsservice.https-only=true 62 | gsservice.gs-endpoint=commondatastorage.googleapis.com 63 | gsservice.gs-endpoint-http-port=80 64 | gsservice.gs-endpoint-https-port=443 65 | 66 | 67 | ### 68 | # CloudFrontService 69 | ### 70 | cloudfront-service.internal-error-retry-max=5 71 | 72 | 73 | ### 74 | # REST/HTTP HttpClient properties 75 | ### 76 | httpclient.max-connections=20 77 | #httpclient.max-connections-per-host=5 78 | 79 | httpclient.retry-max=5 80 | 81 | httpclient.connection-timeout-ms=60000 82 | httpclient.socket-timeout-ms=60000 83 | httpclient.stale-checking-enabled=true 84 | 85 | #httpclient.useragent=My User Agent String 86 | #httpclient.read-throttle=50 87 | httpclient.authentication-preemptive=false 88 | 89 | httpclient.proxy-autodetect=true 90 | #httpclient.proxy-host= 91 | #httpclient.proxy-port= 92 | #httpclient.proxy-user= 93 | #httpclient.proxy-password= 94 | #httpclient.proxy-domain= 95 | 96 | httpclient.requester-pays-buckets-enabled=false 97 | 98 | # TCP window size hints for kernel 99 | #httpclient.socket-receive-buffer=65536 100 | #httpclient.socket-send-buffer=65536 101 | 102 | #httpclient.connection-manager-timeout=0 103 | 104 | 105 | ### 106 | # GUI application properties 107 | ### 108 | gui.verboseErrorDialog=true 109 | 110 | 111 | ### 112 | # Upload properties 113 | ### 114 | uploads.stream-retry-buffer-size=131072 115 | uploads.storeEmptyDirectories=true 116 | 117 | 118 | ### 119 | # Download properties 120 | ### 121 | downloads.restoreLastModifiedDate=true 122 | 123 | 124 | ### 125 | # File/Object comparison properties 126 | ### 127 | 128 | #filecomparer.skip-symlinks=false 129 | #filecomparer.use-md5-files=false 130 | #filecomparer.generate-md5-files=false 131 | #filecomparer.md5-files-root-dir=/custom/path/for/md5/files 132 | #filecomparer.skip-upload-of-md5-files=false 133 | #filecomparer.assume-local-latest-in-mismatch=false 134 | 135 | 136 | ### 137 | # Encryption Algorithm used by JetS3t applications. 138 | # 139 | # This setting does not enable encryption in the JetS3t toolkit as 140 | # a whole. For this, refer to the Javadocs for the EncryptionUtil 141 | # and ObjectUtils classes. 142 | # 143 | # Note that some cryptography options will only be available 144 | # if the Java Cryptography Extension (JCE) Unlimited Strength 145 | # Jurisdiction Policy Files are installed. 146 | ### 147 | crypto.algorithm=PBEWithMD5AndDES 148 | 149 | 150 | ### 151 | # XML Parsing properties 152 | ### 153 | xmlparser.sanitize-listings=true 154 | 155 | 156 | ### 157 | # Amazon DevPay Settings 158 | # 159 | # Default values for DevPay user and product tokens. 160 | ### 161 | 162 | #devpay.user-token= 163 | #devpay.product-token= 164 | -------------------------------------------------------------------------------- /src/test/resources/default.jets3t.properties: -------------------------------------------------------------------------------- 1 | ######################### 2 | # Low-level configuration of jets3t toolkit behaviour. 3 | # 4 | # For detailed documentation, please see: 5 | # http://www.jets3t.org/toolkit/configuration.html 6 | # 7 | # Properties set in this file will affect services and applications 8 | # using the JetS3t library. 9 | ######################### 10 | 11 | 12 | ### 13 | # StorageService (apply to both S3 and Google Storage services) 14 | ### 15 | storage-service.internal-error-retry-max=5 16 | storage-service.disable-live-md5=false 17 | #storage-service.apply-recommended-dns-caching-defaults=true 18 | 19 | ### 20 | # ThreadedStorageService (multi-threaded wrapper for S3 or Google services) 21 | ### 22 | threaded-service.max-thread-count=2 23 | threaded-service.admin-max-thread-count=20 24 | threaded-service.ignore-exceptions-in-multi=false 25 | 26 | 27 | ### 28 | # S3ServiceMulti *DEPRECATED* (multi-threaded wrapper for S3 service) 29 | ### 30 | s3service.max-thread-count=2 31 | s3service.admin-max-thread-count=20 32 | s3service.ignore-exceptions-in-multi=false 33 | 34 | 35 | ### 36 | # RestS3Service 37 | ### 38 | s3service.https-only=true 39 | 40 | s3service.s3-endpoint=s3.amazonaws.com 41 | s3service.s3-endpoint-http-port=80 42 | s3service.s3-endpoint-https-port=443 43 | s3service.disable-dns-buckets=false 44 | 45 | s3service.default-bucket-location=US 46 | 47 | s3service.enable-storage-classes=true 48 | s3service.default-storage-class=STANDARD 49 | #s3service.default-storage-class=REDUCED_REDUNDANCY 50 | 51 | # Uncomment this directive to use Amazon S3's server-side encryption 52 | #s3service.server-side-encryption=AES256 53 | 54 | # Virtual path for non-standard servers, such as Eucalyptus 55 | #s3service.s3-endpoint-virtual-path=/services/Walrus 56 | 57 | 58 | ### 59 | # GoogleStorageService 60 | ### 61 | gsservice.https-only=true 62 | gsservice.gs-endpoint=commondatastorage.googleapis.com 63 | gsservice.gs-endpoint-http-port=80 64 | gsservice.gs-endpoint-https-port=443 65 | 66 | 67 | ### 68 | # CloudFrontService 69 | ### 70 | cloudfront-service.internal-error-retry-max=5 71 | 72 | 73 | ### 74 | # REST/HTTP HttpClient properties 75 | ### 76 | httpclient.max-connections=20 77 | #httpclient.max-connections-per-host=5 78 | 79 | httpclient.retry-max=5 80 | 81 | httpclient.connection-timeout-ms=60000 82 | httpclient.socket-timeout-ms=60000 83 | httpclient.stale-checking-enabled=true 84 | 85 | #httpclient.useragent=My User Agent String 86 | #httpclient.read-throttle=50 87 | httpclient.authentication-preemptive=false 88 | 89 | httpclient.proxy-autodetect=true 90 | #httpclient.proxy-host= 91 | #httpclient.proxy-port= 92 | #httpclient.proxy-user= 93 | #httpclient.proxy-password= 94 | #httpclient.proxy-domain= 95 | 96 | httpclient.requester-pays-buckets-enabled=false 97 | 98 | # TCP window size hints for kernel 99 | #httpclient.socket-receive-buffer=65536 100 | #httpclient.socket-send-buffer=65536 101 | 102 | #httpclient.connection-manager-timeout=0 103 | 104 | 105 | ### 106 | # GUI application properties 107 | ### 108 | gui.verboseErrorDialog=true 109 | 110 | 111 | ### 112 | # Upload properties 113 | ### 114 | uploads.stream-retry-buffer-size=131072 115 | uploads.storeEmptyDirectories=true 116 | 117 | 118 | ### 119 | # Download properties 120 | ### 121 | downloads.restoreLastModifiedDate=true 122 | 123 | 124 | ### 125 | # File/Object comparison properties 126 | ### 127 | 128 | #filecomparer.skip-symlinks=false 129 | #filecomparer.use-md5-files=false 130 | #filecomparer.generate-md5-files=false 131 | #filecomparer.md5-files-root-dir=/custom/path/for/md5/files 132 | #filecomparer.skip-upload-of-md5-files=false 133 | #filecomparer.assume-local-latest-in-mismatch=false 134 | 135 | 136 | ### 137 | # Encryption Algorithm used by JetS3t applications. 138 | # 139 | # This setting does not enable encryption in the JetS3t toolkit as 140 | # a whole. For this, refer to the Javadocs for the EncryptionUtil 141 | # and ObjectUtils classes. 142 | # 143 | # Note that some cryptography options will only be available 144 | # if the Java Cryptography Extension (JCE) Unlimited Strength 145 | # Jurisdiction Policy Files are installed. 146 | ### 147 | crypto.algorithm=PBEWithMD5AndDES 148 | 149 | 150 | ### 151 | # XML Parsing properties 152 | ### 153 | xmlparser.sanitize-listings=true 154 | 155 | 156 | ### 157 | # Amazon DevPay Settings 158 | # 159 | # Default values for DevPay user and product tokens. 160 | ### 161 | 162 | #devpay.user-token= 163 | #devpay.product-token= 164 | -------------------------------------------------------------------------------- /src/main/groovy/com/monochromeroad/gradle/plugin/aws/s3/S3Sync.groovy: -------------------------------------------------------------------------------- 1 | package com.monochromeroad.gradle.plugin.aws.s3 2 | 3 | import org.gradle.api.DefaultTask 4 | import org.gradle.api.tasks.TaskAction 5 | import org.gradle.api.PathValidation 6 | import org.jets3t.apps.synchronize.Synchronize 7 | import org.jets3t.service.impl.rest.httpclient.RestS3Service 8 | import org.jets3t.service.security.AWSCredentials 9 | import org.jets3t.service.Jets3tProperties 10 | import org.jets3t.service.utils.Mimetypes 11 | 12 | /** 13 | * Main task class for the plugin 14 | * 15 | * @author Masatoshi Hayashi 16 | */ 17 | class S3Sync extends DefaultTask { 18 | 19 | private static final DEFAULT_JETS3T_PROPERTIES_NAME = "default.jets3t.properties" 20 | 21 | def accessKey 22 | 23 | def secretKey 24 | 25 | def quiet 26 | 27 | def noProgress 28 | 29 | def force 30 | 31 | def keepFiles 32 | 33 | def noDelete 34 | 35 | def gzipEnabled 36 | 37 | def encryptionEnabled 38 | 39 | def moveEnabled 40 | 41 | def batchMode 42 | 43 | Jets3tProperties jets3tProperties = createNewJets3tProperties(DEFAULT_JETS3T_PROPERTIES_NAME) 44 | 45 | ACL acl = ACL.Private 46 | 47 | String action = 'UP' 48 | 49 | ReportLevel reportLevel = ReportLevel.All 50 | 51 | private _configFile 52 | 53 | private String originalSourcePath 54 | 55 | private File sourceDir 56 | 57 | private String destination 58 | 59 | void from(sourcePath) { 60 | originalSourcePath = sourcePath 61 | sourceDir = project.file(sourcePath) 62 | } 63 | 64 | void into(destinationPath) { 65 | destination = destinationPath.toString() 66 | } 67 | 68 | @TaskAction 69 | def sync() { 70 | def awsCredentials = new AWSCredentials(accessKey, secretKey) 71 | def s3Service = new RestS3Service(awsCredentials) 72 | 73 | boolean doAction = true; 74 | boolean isQuiet = quiet == true; 75 | boolean isNoProgress = noProgress == true; 76 | boolean isForce = force == true; 77 | boolean isKeepFiles = keepFiles == true; 78 | boolean isNoDelete = noDelete == true; 79 | boolean isGzipEnabled = gzipEnabled == true; 80 | boolean isEncryptionEnabled = encryptionEnabled == true; 81 | boolean isMoveEnabled = moveEnabled == true; 82 | boolean isBatchMode = batchMode == true; 83 | String aclString = acl.toString() 84 | 85 | Synchronize client = new Synchronize( 86 | s3Service, doAction, isQuiet, isNoProgress, isForce, isKeepFiles, isNoDelete, 87 | isMoveEnabled, isBatchMode, isGzipEnabled, isEncryptionEnabled, 88 | reportLevel.level, jets3tProperties); 89 | 90 | if (action == 'UP'){ 91 | final useMD5 = jets3tProperties.getBoolProperty("filecomparer.use-md5-files", false); 92 | if (useMD5) { 93 | new File(jets3tProperties.getStringProperty("filecomparer.md5-files-root-dir", "")).mkdirs(); 94 | } 95 | def sources = sourceDir.listFiles() 96 | if (sources) { 97 | client.run(destination, sources, 98 | action, 99 | jets3tProperties.getStringProperty("password", null), aclString, 100 | "S3"); 101 | } else { 102 | logger.warn("No files found in given source directory '${sourceDir}'.") 103 | } 104 | } 105 | else if (action == 'DOWN'){ 106 | project.file(destination).mkdirs() 107 | def dest = [new File(destination)] 108 | client.run(originalSourcePath, dest, 109 | action, 110 | jets3tProperties.getStringProperty("password", null), aclString, 111 | "S3"); 112 | } 113 | else{ 114 | logger.error("unkown action '${action}'") 115 | } 116 | 117 | } 118 | 119 | def getConfigFile() { return _configFile } 120 | 121 | void configFile(configFile) { 122 | this._configFile = configFile 123 | 124 | if (!configFile) return 125 | 126 | this.jets3tProperties = 127 | loadJets3tProperties(project.file(configFile, PathValidation.FILE)) 128 | } 129 | 130 | void mimeTypesFile(mimeFile) { 131 | project.file(mimeFile).withInputStream { 132 | Mimetypes.instance.loadAndReplaceMimetypes(it) 133 | } 134 | } 135 | 136 | private static Jets3tProperties loadJets3tProperties(File configFile) { 137 | String identifier = 'user-jets3t-props' + configFile.toString() 138 | 139 | Jets3tProperties newJets3tProperties = createNewJets3tProperties(identifier) 140 | 141 | if (configFile.canRead()) { 142 | configFile.withInputStream { 143 | newJets3tProperties.loadAndReplaceProperties(it, identifier) 144 | } 145 | } else { 146 | throw new IllegalStateException("the config file cannot be read : " + configFile.absolutePath) 147 | } 148 | 149 | return newJets3tProperties 150 | } 151 | 152 | private static Jets3tProperties createNewJets3tProperties(String identifier) { 153 | S3Sync.class.getResourceAsStream("/" + DEFAULT_JETS3T_PROPERTIES_NAME).withStream { 154 | return Jets3tProperties.getInstance(it, identifier) 155 | } 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save ( ) { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/literalice/gradle-aws-s3-sync.svg?branch=master)](https://travis-ci.org/literalice/gradle-aws-s3-sync) 2 | 3 | This is the gradle task for synchronizing a local directory with a AWS S3 bucket and vice-versa. 4 | 5 | This task depends on [JetS3t](http://jets3t.s3.amazonaws.com/index.html), a open-source Java toolkit for AWS. 6 | 7 | ## Situation - upload 8 | 9 | This task assumes the case, for example, a web site would be published in a AWS S3 bucket. 10 | 11 | ## Usage - upload 12 | 13 | ```groovy 14 | // Gradle Script 15 | buildscript { 16 | repositories { 17 | jcenter() 18 | } 19 | 20 | dependencies { 21 | classpath "com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:0.10" 22 | } 23 | } 24 | 25 | import com.monochromeroad.gradle.plugin.aws.s3.S3Sync 26 | 27 | task deploy(type: S3Sync){ 28 | description = "Deploys my site on a s3 bucket." 29 | 30 | accessKey awsAccessKey 31 | secretKey awsSecretKey 32 | 33 | configFile "jets3t.properties" 34 | mimeTypesFile "my-mime.types" 35 | 36 | from "local-site" 37 | into "my.bucket.name/subdirectory-optional" 38 | } 39 | ``` 40 | 41 | ## Situation - download 42 | 43 | This task assumes the case, for example, a set of files has to be fetched from an S3 bucket to a local directory. 44 | 45 | ### Usage - download 46 | 47 | ```groovy 48 | // Gradle Script 49 | buildscript { 50 | repositories { 51 | jcenter() 52 | } 53 | 54 | dependencies { 55 | classpath "com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:0.10" 56 | } 57 | } 58 | 59 | import com.monochromeroad.gradle.plugin.aws.s3.S3Sync 60 | 61 | task deploy(type: S3Sync){ 62 | description = "Downloads files from s3 bucket to a local directory" 63 | 64 | accessKey awsAccessKey 65 | secretKey awsSecretKey 66 | 67 | configFile "jets3t.properties" 68 | 69 | // follows the jets3t conventions for action names 70 | action = 'DOWN' 71 | 72 | from "my.bucket.name/subdirectory-optional" 73 | from "local-site" 74 | } 75 | ``` 76 | 77 | # Options 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 |
Name * requiredDescriptionDefault Value
* accessKey()AWS Access Key-
* secretKey()AWS Secret Key-
* from()The local directory which would be synchronized with the S3 bucket-
* into()The S3 bucket name which would be synchronized with the local directory. If needed, some sub directory could be added. (e.g. buc.ket/sub.d)-
configFile()JetS3t properties file path. Interpreted relative to the project directory, as for project.file() method.-
See also: JetS3t's Default
mimeTypesFile()Mime types file path for determing Mime type on deploying to S3. Interpreted relative to the project directory, as for project.file() method.-
See also: Default
quiet()JetS3t option -qfalse
noProgress()JetS3t option -nfalse
force()JetS3t option -ffalse
keepFiles()JetS3t option -kfalse
noDelete()JetS3t option -dfalse
moveEnabled()JetS3t option -mfalse
batchMode()JetS3t option -bfalse
gzipEnabled()JetS3t option -gfalse
encryptionEnabled()JetS3t option -cfalse
acl()JetS3t option --acl, from enum "ACL"com.monochromeroad.gradle.plugin.aws.s3.ACL.Private
reportLevel(ReportLevel)JetS3t option --reportlevel, from enum "ReportLevel"com.monochromeroad.gradle.plugin.aws.s3.ReportLevel.All
action()Either 'UP' for uploading into S3 or 'DOWN' for downloading from S3.UP
177 | 178 | -------------------------------------------------------------------------------- /src/main/resources/mime.types: -------------------------------------------------------------------------------- 1 | # This is a comment. I love comments. 2 | 3 | # This file controls what Internet media types are sent to the client for 4 | # given file extension(s). Sending the correct media type to the client 5 | # is important so they know how to handle the content of the file. 6 | # Extra types can either be added here or by using an AddType directive 7 | # in your config files. For more information about Internet media types, 8 | # please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type 9 | # registry is at . 10 | 11 | # MIME type Extensions 12 | 13 | # Default mimetype 14 | application/octet-stream * 15 | 16 | application/activemessage 17 | application/andrew-inset ez 18 | application/applefile 19 | application/atom+xml atom 20 | application/atomicmail 21 | application/batch-smtp 22 | application/beep+xml 23 | application/cals-1840 24 | application/cnrp+xml 25 | application/commonground 26 | application/cpl+xml 27 | application/cybercash 28 | application/dca-rft 29 | application/dec-dx 30 | application/dvcs 31 | application/edi-consent 32 | application/edifact 33 | application/edi-x12 34 | application/eshop 35 | application/font-tdpfr 36 | application/http 37 | application/hyperstudio 38 | application/iges 39 | application/index 40 | application/index.cmd 41 | application/index.obj 42 | application/index.response 43 | application/index.vnd 44 | application/iotp 45 | application/ipp 46 | application/isup 47 | application/mac-binhex40 hqx 48 | application/mac-compactpro cpt 49 | application/macwriteii 50 | application/marc 51 | application/mathematica 52 | application/mathml+xml mathml 53 | application/msword doc 54 | application/news-message-id 55 | application/news-transmission 56 | application/ocsp-request 57 | application/ocsp-response 58 | application/octet-stream bin dms lha lzh exe class so dll dmg 59 | application/oda oda 60 | application/ogg ogg 61 | application/parityfec 62 | application/pdf pdf 63 | application/pgp-encrypted 64 | application/pgp-keys 65 | application/pgp-signature 66 | application/pkcs10 67 | application/pkcs7-mime 68 | application/pkcs7-signature 69 | application/pkix-cert 70 | application/pkix-crl 71 | application/pkixcmp 72 | application/postscript ai eps ps 73 | application/prs.alvestrand.titrax-sheet 74 | application/prs.cww 75 | application/prs.nprend 76 | application/prs.plucker 77 | application/qsig 78 | application/rdf+xml rdf 79 | application/reginfo+xml 80 | application/remote-printing 81 | application/riscos 82 | application/rtf 83 | application/sdp 84 | application/set-payment 85 | application/set-payment-initiation 86 | application/set-registration 87 | application/set-registration-initiation 88 | application/sgml 89 | application/sgml-open-catalog 90 | application/sieve 91 | application/slate 92 | application/smil smi smil 93 | application/srgs gram 94 | application/srgs+xml grxml 95 | application/timestamp-query 96 | application/timestamp-reply 97 | application/tve-trigger 98 | application/vemmi 99 | application/vnd.3gpp.pic-bw-large 100 | application/vnd.3gpp.pic-bw-small 101 | application/vnd.3gpp.pic-bw-var 102 | application/vnd.3gpp.sms 103 | application/vnd.3m.post-it-notes 104 | application/vnd.accpac.simply.aso 105 | application/vnd.accpac.simply.imp 106 | application/vnd.acucobol 107 | application/vnd.acucorp 108 | application/vnd.adobe.xfdf 109 | application/vnd.aether.imp 110 | application/vnd.amiga.ami 111 | application/vnd.anser-web-certificate-issue-initiation 112 | application/vnd.anser-web-funds-transfer-initiation 113 | application/vnd.audiograph 114 | application/vnd.blueice.multipass 115 | application/vnd.bmi 116 | application/vnd.businessobjects 117 | application/vnd.canon-cpdl 118 | application/vnd.canon-lips 119 | application/vnd.cinderella 120 | application/vnd.claymore 121 | application/vnd.commerce-battelle 122 | application/vnd.commonspace 123 | application/vnd.contact.cmsg 124 | application/vnd.cosmocaller 125 | application/vnd.criticaltools.wbs+xml 126 | application/vnd.ctc-posml 127 | application/vnd.cups-postscript 128 | application/vnd.cups-raster 129 | application/vnd.cups-raw 130 | application/vnd.curl 131 | application/vnd.cybank 132 | application/vnd.data-vision.rdz 133 | application/vnd.dna 134 | application/vnd.dpgraph 135 | application/vnd.dreamfactory 136 | application/vnd.dxr 137 | application/vnd.ecdis-update 138 | application/vnd.ecowin.chart 139 | application/vnd.ecowin.filerequest 140 | application/vnd.ecowin.fileupdate 141 | application/vnd.ecowin.series 142 | application/vnd.ecowin.seriesrequest 143 | application/vnd.ecowin.seriesupdate 144 | application/vnd.enliven 145 | application/vnd.epson.esf 146 | application/vnd.epson.msf 147 | application/vnd.epson.quickanime 148 | application/vnd.epson.salt 149 | application/vnd.epson.ssf 150 | application/vnd.ericsson.quickcall 151 | application/vnd.eudora.data 152 | application/vnd.fdf 153 | application/vnd.ffsns 154 | application/vnd.fints 155 | application/vnd.flographit 156 | application/vnd.framemaker 157 | application/vnd.fsc.weblaunch 158 | application/vnd.fujitsu.oasys 159 | application/vnd.fujitsu.oasys2 160 | application/vnd.fujitsu.oasys3 161 | application/vnd.fujitsu.oasysgp 162 | application/vnd.fujitsu.oasysprs 163 | application/vnd.fujixerox.ddd 164 | application/vnd.fujixerox.docuworks 165 | application/vnd.fujixerox.docuworks.binder 166 | application/vnd.fut-misnet 167 | application/vnd.grafeq 168 | application/vnd.groove-account 169 | application/vnd.groove-help 170 | application/vnd.groove-identity-message 171 | application/vnd.groove-injector 172 | application/vnd.groove-tool-message 173 | application/vnd.groove-tool-template 174 | application/vnd.groove-vcard 175 | application/vnd.hbci 176 | application/vnd.hhe.lesson-player 177 | application/vnd.hp-hpgl 178 | application/vnd.hp-hpid 179 | application/vnd.hp-hps 180 | application/vnd.hp-pcl 181 | application/vnd.hp-pclxl 182 | application/vnd.httphone 183 | application/vnd.hzn-3d-crossword 184 | application/vnd.ibm.afplinedata 185 | application/vnd.ibm.electronic-media 186 | application/vnd.ibm.minipay 187 | application/vnd.ibm.modcap 188 | application/vnd.ibm.rights-management 189 | application/vnd.ibm.secure-container 190 | application/vnd.informix-visionary 191 | application/vnd.intercon.formnet 192 | application/vnd.intertrust.digibox 193 | application/vnd.intertrust.nncp 194 | application/vnd.intu.qbo 195 | application/vnd.intu.qfx 196 | application/vnd.irepository.package+xml 197 | application/vnd.is-xpr 198 | application/vnd.japannet-directory-service 199 | application/vnd.japannet-jpnstore-wakeup 200 | application/vnd.japannet-payment-wakeup 201 | application/vnd.japannet-registration 202 | application/vnd.japannet-registration-wakeup 203 | application/vnd.japannet-setstore-wakeup 204 | application/vnd.japannet-verification 205 | application/vnd.japannet-verification-wakeup 206 | application/vnd.jisp 207 | application/vnd.kde.karbon 208 | application/vnd.kde.kchart 209 | application/vnd.kde.kformula 210 | application/vnd.kde.kivio 211 | application/vnd.kde.kontour 212 | application/vnd.kde.kpresenter 213 | application/vnd.kde.kspread 214 | application/vnd.kde.kword 215 | application/vnd.kenameaapp 216 | application/vnd.koan 217 | application/vnd.liberty-request+xml 218 | application/vnd.llamagraphics.life-balance.desktop 219 | application/vnd.llamagraphics.life-balance.exchange+xml 220 | application/vnd.lotus-1-2-3 221 | application/vnd.lotus-approach 222 | application/vnd.lotus-freelance 223 | application/vnd.lotus-notes 224 | application/vnd.lotus-organizer 225 | application/vnd.lotus-screencam 226 | application/vnd.lotus-wordpro 227 | application/vnd.mcd 228 | application/vnd.mediastation.cdkey 229 | application/vnd.meridian-slingshot 230 | application/vnd.micrografx.flo 231 | application/vnd.micrografx.igx 232 | application/vnd.mif mif 233 | application/vnd.minisoft-hp3000-save 234 | application/vnd.mitsubishi.misty-guard.trustweb 235 | application/vnd.mobius.daf 236 | application/vnd.mobius.dis 237 | application/vnd.mobius.mbk 238 | application/vnd.mobius.mqy 239 | application/vnd.mobius.msl 240 | application/vnd.mobius.plc 241 | application/vnd.mobius.txf 242 | application/vnd.mophun.application 243 | application/vnd.mophun.certificate 244 | application/vnd.motorola.flexsuite 245 | application/vnd.motorola.flexsuite.adsi 246 | application/vnd.motorola.flexsuite.fis 247 | application/vnd.motorola.flexsuite.gotap 248 | application/vnd.motorola.flexsuite.kmr 249 | application/vnd.motorola.flexsuite.ttc 250 | application/vnd.motorola.flexsuite.wem 251 | application/vnd.mozilla.xul+xml xul 252 | application/vnd.ms-artgalry 253 | application/vnd.ms-asf 254 | application/vnd.ms-excel xls 255 | application/vnd.ms-lrm 256 | application/vnd.ms-powerpoint ppt 257 | application/vnd.ms-project 258 | application/vnd.ms-tnef 259 | application/vnd.ms-works 260 | application/vnd.ms-wpl 261 | application/vnd.mseq 262 | application/vnd.msign 263 | application/vnd.music-niff 264 | application/vnd.musician 265 | application/vnd.netfpx 266 | application/vnd.noblenet-directory 267 | application/vnd.noblenet-sealer 268 | application/vnd.noblenet-web 269 | application/vnd.novadigm.edm 270 | application/vnd.novadigm.edx 271 | application/vnd.novadigm.ext 272 | application/vnd.obn 273 | application/vnd.osa.netdeploy 274 | application/vnd.palm 275 | application/vnd.pg.format 276 | application/vnd.pg.osasli 277 | application/vnd.powerbuilder6 278 | application/vnd.powerbuilder6-s 279 | application/vnd.powerbuilder7 280 | application/vnd.powerbuilder7-s 281 | application/vnd.powerbuilder75 282 | application/vnd.powerbuilder75-s 283 | application/vnd.previewsystems.box 284 | application/vnd.publishare-delta-tree 285 | application/vnd.pvi.ptid1 286 | application/vnd.pwg-multiplexed 287 | application/vnd.pwg-xhtml-print+xml 288 | application/vnd.quark.quarkxpress 289 | application/vnd.rapid 290 | application/vnd.rn-realmedia rm 291 | application/vnd.s3sms 292 | application/vnd.sealed.net 293 | application/vnd.seemail 294 | application/vnd.shana.informed.formdata 295 | application/vnd.shana.informed.formtemplate 296 | application/vnd.shana.informed.interchange 297 | application/vnd.shana.informed.package 298 | application/vnd.smaf 299 | application/vnd.sss-cod 300 | application/vnd.sss-dtf 301 | application/vnd.sss-ntf 302 | application/vnd.street-stream 303 | application/vnd.svd 304 | application/vnd.swiftview-ics 305 | application/vnd.triscape.mxs 306 | application/vnd.trueapp 307 | application/vnd.truedoc 308 | application/vnd.ufdl 309 | application/vnd.uplanet.alert 310 | application/vnd.uplanet.alert-wbxml 311 | application/vnd.uplanet.bearer-choice 312 | application/vnd.uplanet.bearer-choice-wbxml 313 | application/vnd.uplanet.cacheop 314 | application/vnd.uplanet.cacheop-wbxml 315 | application/vnd.uplanet.channel 316 | application/vnd.uplanet.channel-wbxml 317 | application/vnd.uplanet.list 318 | application/vnd.uplanet.list-wbxml 319 | application/vnd.uplanet.listcmd 320 | application/vnd.uplanet.listcmd-wbxml 321 | application/vnd.uplanet.signal 322 | application/vnd.vcx 323 | application/vnd.vectorworks 324 | application/vnd.vidsoft.vidconference 325 | application/vnd.visio 326 | application/vnd.visionary 327 | application/vnd.vividence.scriptfile 328 | application/vnd.vsf 329 | application/vnd.wap.sic 330 | application/vnd.wap.slc 331 | application/vnd.wap.wbxml wbxml 332 | application/vnd.wap.wmlc wmlc 333 | application/vnd.wap.wmlscriptc wmlsc 334 | application/vnd.webturbo 335 | application/vnd.wrq-hp3000-labelled 336 | application/vnd.wt.stf 337 | application/vnd.wv.csp+wbxml 338 | application/vnd.xara 339 | application/vnd.xfdl 340 | application/vnd.yamaha.hv-dic 341 | application/vnd.yamaha.hv-script 342 | application/vnd.yamaha.hv-voice 343 | application/vnd.yellowriver-custom-menu 344 | application/voicexml+xml vxml 345 | application/watcherinfo+xml 346 | application/whoispp-query 347 | application/whoispp-response 348 | application/wita 349 | application/wordperfect5.1 350 | application/x-bcpio bcpio 351 | application/x-cdlink vcd 352 | application/x-chess-pgn pgn 353 | application/x-compress 354 | application/x-cpio cpio 355 | application/x-csh csh 356 | application/x-director dcr dir dxr 357 | application/x-dvi dvi 358 | application/x-futuresplash spl 359 | application/x-gtar gtar 360 | application/x-gzip gz 361 | application/x-hdf hdf 362 | application/x-javascript js 363 | application/x-java-jnlp-file jnlp 364 | application/x-koan skp skd skt skm 365 | application/x-latex latex 366 | application/x-netcdf nc cdf 367 | application/x-sh sh 368 | application/x-shar shar 369 | application/x-shockwave-flash swf 370 | application/x-stuffit sit 371 | application/x-sv4cpio sv4cpio 372 | application/x-sv4crc sv4crc 373 | application/x-tar tar 374 | application/x-tcl tcl 375 | application/x-tex tex 376 | application/x-texinfo texinfo texi 377 | application/x-troff t tr roff 378 | application/x-troff-man man 379 | application/x-troff-me me 380 | application/x-troff-ms ms 381 | application/x-ustar ustar 382 | application/x-wais-source src 383 | application/x400-bp 384 | application/xhtml+xml xhtml xht 385 | application/xslt+xml xslt 386 | application/xml xml xsl 387 | application/xml-dtd dtd 388 | application/xml-external-parsed-entity 389 | application/zip zip 390 | audio/32kadpcm 391 | audio/amr 392 | audio/amr-wb 393 | audio/basic au snd 394 | audio/cn 395 | audio/dat12 396 | audio/dsr-es201108 397 | audio/dvi4 398 | audio/evrc 399 | audio/evrc0 400 | audio/g722 401 | audio/g.722.1 402 | audio/g723 403 | audio/g726-16 404 | audio/g726-24 405 | audio/g726-32 406 | audio/g726-40 407 | audio/g728 408 | audio/g729 409 | audio/g729D 410 | audio/g729E 411 | audio/gsm 412 | audio/gsm-efr 413 | audio/l8 414 | audio/l16 415 | audio/l20 416 | audio/l24 417 | audio/lpc 418 | audio/midi mid midi kar 419 | audio/mpa 420 | audio/mpa-robust 421 | audio/mp4a-latm m4a m4p 422 | audio/mpeg mpga mp2 mp3 423 | audio/parityfec 424 | audio/pcma 425 | audio/pcmu 426 | audio/prs.sid 427 | audio/qcelp 428 | audio/red 429 | audio/smv 430 | audio/smv0 431 | audio/telephone-event 432 | audio/tone 433 | audio/vdvi 434 | audio/vnd.3gpp.iufp 435 | audio/vnd.cisco.nse 436 | audio/vnd.cns.anp1 437 | audio/vnd.cns.inf1 438 | audio/vnd.digital-winds 439 | audio/vnd.everad.plj 440 | audio/vnd.lucent.voice 441 | audio/vnd.nortel.vbk 442 | audio/vnd.nuera.ecelp4800 443 | audio/vnd.nuera.ecelp7470 444 | audio/vnd.nuera.ecelp9600 445 | audio/vnd.octel.sbc 446 | audio/vnd.qcelp 447 | audio/vnd.rhetorex.32kadpcm 448 | audio/vnd.vmx.cvsd 449 | audio/x-aiff aif aiff aifc 450 | audio/x-alaw-basic 451 | audio/x-mpegurl m3u 452 | audio/x-pn-realaudio ram ra 453 | audio/x-pn-realaudio-plugin 454 | audio/x-wav wav 455 | chemical/x-pdb pdb 456 | chemical/x-xyz xyz 457 | image/bmp bmp 458 | image/cgm cgm 459 | image/g3fax 460 | image/gif gif 461 | image/ief ief 462 | image/jpeg jpeg jpg jpe 463 | image/jp2 jp2 464 | image/naplps 465 | image/pict pict pic pct 466 | image/png png 467 | image/prs.btif 468 | image/prs.pti 469 | image/svg+xml svg 470 | image/t38 471 | image/tiff tiff tif 472 | image/tiff-fx 473 | image/vnd.cns.inf2 474 | image/vnd.djvu djvu djv 475 | image/vnd.dwg 476 | image/vnd.dxf 477 | image/vnd.fastbidsheet 478 | image/vnd.fpx 479 | image/vnd.fst 480 | image/vnd.fujixerox.edmics-mmr 481 | image/vnd.fujixerox.edmics-rlc 482 | image/vnd.globalgraphics.pgb 483 | image/vnd.mix 484 | image/vnd.ms-modi 485 | image/vnd.net-fpx 486 | image/vnd.svf 487 | image/vnd.wap.wbmp wbmp 488 | image/vnd.xiff 489 | image/x-cmu-raster ras 490 | image/x-macpaint pntg pnt mac 491 | image/x-icon ico 492 | image/x-portable-anymap pnm 493 | image/x-portable-bitmap pbm 494 | image/x-portable-graymap pgm 495 | image/x-portable-pixmap ppm 496 | image/x-quicktime qtif qti 497 | image/x-rgb rgb 498 | image/x-xbitmap xbm 499 | image/x-xpixmap xpm 500 | image/x-xwindowdump xwd 501 | message/delivery-status 502 | message/disposition-notification 503 | message/external-body 504 | message/http 505 | message/news 506 | message/partial 507 | message/rfc822 508 | message/s-http 509 | message/sip 510 | message/sipfrag 511 | model/iges igs iges 512 | model/mesh msh mesh silo 513 | model/vnd.dwf 514 | model/vnd.flatland.3dml 515 | model/vnd.gdl 516 | model/vnd.gs-gdl 517 | model/vnd.gtw 518 | model/vnd.mts 519 | model/vnd.parasolid.transmit.binary 520 | model/vnd.parasolid.transmit.text 521 | model/vnd.vtu 522 | model/vrml wrl vrml 523 | multipart/alternative 524 | multipart/appledouble 525 | multipart/byteranges 526 | multipart/digest 527 | multipart/encrypted 528 | multipart/form-data 529 | multipart/header-set 530 | multipart/mixed 531 | multipart/parallel 532 | multipart/related 533 | multipart/report 534 | multipart/signed 535 | multipart/voice-message 536 | text/calendar ics ifb 537 | text/css css 538 | text/directory 539 | text/enriched 540 | text/html html htm 541 | text/parityfec 542 | text/plain asc txt 543 | text/prs.lines.tag 544 | text/rfc822-headers 545 | text/richtext rtx 546 | text/rtf rtf 547 | text/sgml sgml sgm 548 | text/t140 549 | text/tab-separated-values tsv 550 | text/uri-list 551 | text/vnd.abc 552 | text/vnd.curl 553 | text/vnd.dmclientscript 554 | text/vnd.fly 555 | text/vnd.fmi.flexstor 556 | text/vnd.in3d.3dml 557 | text/vnd.in3d.spot 558 | text/vnd.iptc.nitf 559 | text/vnd.iptc.newsml 560 | text/vnd.latex-z 561 | text/vnd.motorola.reflex 562 | text/vnd.ms-mediapackage 563 | text/vnd.net2phone.commcenter.command 564 | text/vnd.sun.j2me.app-descriptor 565 | text/vnd.wap.si 566 | text/vnd.wap.sl 567 | text/vnd.wap.wml wml 568 | text/vnd.wap.wmlscript wmls 569 | text/x-setext etx 570 | text/xml 571 | text/xml-external-parsed-entity 572 | video/3gpp 3gp 573 | video/bmpeg 574 | video/bt656 575 | video/celb 576 | video/dv 577 | video/h261 578 | video/h263 579 | video/h263-1998 580 | video/h263-2000 581 | video/jpeg 582 | video/mp1s 583 | video/mp2p 584 | video/mp2t 585 | video/mp4 mp4 586 | video/mp4v-es 587 | video/mpv 588 | video/mpeg mpeg mpg mpe 589 | video/nv 590 | video/parityfec 591 | video/pointer 592 | video/quicktime qt mov 593 | video/smpte292m 594 | video/vnd.fvt 595 | video/vnd.motorola.video 596 | video/vnd.motorola.videop 597 | video/vnd.mpegurl mxu m4u 598 | video/vnd.nokia.interleaved-multimedia 599 | video/vnd.objectvideo 600 | video/vnd.vivo 601 | video/x-dv dv dif 602 | video/x-flv flv 603 | video/x-ms-wmv wmv 604 | video/x-msvideo avi 605 | video/x-sgi-movie movie 606 | x-conference/x-cooltalk ice 607 | --------------------------------------------------------------------------------