embulk 0.8.39-java → 0.10.24-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +1 -1
- data/LICENSE +202 -0
- data/embulk.gemspec +34 -33
- data/lib/embulk.rb +5 -61
- data/lib/embulk/buffer.rb +1 -2
- data/lib/embulk/guess/charset.rb +2 -11
- data/lib/embulk/java/bootstrap.rb +0 -1
- data/lib/embulk/java_plugin.rb +9 -1
- data/lib/embulk/page_builder.rb +2 -2
- data/lib/embulk/plugin.rb +2 -2
- data/lib/embulk/schema.rb +3 -4
- data/lib/embulk/version.rb +3 -22
- metadata +22 -757
- data/.gitignore +0 -15
- data/.ruby-version +0 -1
- data/.travis.yml +0 -28
- data/COPYING +0 -14
- data/Gemfile.lock +0 -30
- data/README.md +0 -229
- data/Rakefile +0 -26
- data/appveyor.yml +0 -28
- data/bin/embulk +0 -139
- data/build.gradle +0 -419
- data/embulk-cli/build.gradle +0 -9
- data/embulk-cli/src/main/bat/selfrun.bat +0 -107
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkArguments.java +0 -54
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkCommandLine.java +0 -227
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkCommandLineException.java +0 -25
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkExample.java +0 -86
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkMigrate.java +0 -480
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkNew.java +0 -419
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkRun.java +0 -786
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkSelfUpdate.java +0 -235
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkSubcommand.java +0 -47
- data/embulk-cli/src/main/java/org/embulk/cli/Main.java +0 -31
- data/embulk-cli/src/main/java/org/embulk/cli/parse/AbstractHelpLineDefinition.java +0 -15
- data/embulk-cli/src/main/java/org/embulk/cli/parse/CliHelpFormatterWithHelpMessages.java +0 -141
- data/embulk-cli/src/main/java/org/embulk/cli/parse/CliOptionsWithHelpMessages.java +0 -45
- data/embulk-cli/src/main/java/org/embulk/cli/parse/EmbulkCommandLineHelpRequired.java +0 -10
- data/embulk-cli/src/main/java/org/embulk/cli/parse/EmbulkCommandLineParseException.java +0 -25
- data/embulk-cli/src/main/java/org/embulk/cli/parse/EmbulkCommandLineParser.java +0 -187
- data/embulk-cli/src/main/java/org/embulk/cli/parse/HelpMessageAsCliOption.java +0 -36
- data/embulk-cli/src/main/java/org/embulk/cli/parse/HelpMessageLineDefinition.java +0 -20
- data/embulk-cli/src/main/java/org/embulk/cli/parse/OptionBehavior.java +0 -39
- data/embulk-cli/src/main/java/org/embulk/cli/parse/OptionDefinition.java +0 -120
- data/embulk-cli/src/main/sh/selfrun.sh +0 -60
- data/embulk-cli/src/test/java/org/embulk/cli/DummyMain.java +0 -23
- data/embulk-cli/src/test/java/org/embulk/cli/SelfrunTest.java +0 -296
- data/embulk-core/build.gradle +0 -83
- data/embulk-core/src/main/java/org/embulk/EmbulkEmbed.java +0 -321
- data/embulk-core/src/main/java/org/embulk/EmbulkRunner.java +0 -531
- data/embulk-core/src/main/java/org/embulk/EmbulkService.java +0 -78
- data/embulk-core/src/main/java/org/embulk/EmbulkSetup.java +0 -49
- data/embulk-core/src/main/java/org/embulk/EmbulkVersion.java +0 -109
- data/embulk-core/src/main/java/org/embulk/command/PreviewPrinter.java +0 -87
- data/embulk-core/src/main/java/org/embulk/command/TablePreviewPrinter.java +0 -107
- data/embulk-core/src/main/java/org/embulk/command/VerticalPreviewPrinter.java +0 -47
- data/embulk-core/src/main/java/org/embulk/config/CommitReport.java +0 -36
- data/embulk-core/src/main/java/org/embulk/config/Config.java +0 -15
- data/embulk-core/src/main/java/org/embulk/config/ConfigDefault.java +0 -15
- data/embulk-core/src/main/java/org/embulk/config/ConfigDiff.java +0 -32
- data/embulk-core/src/main/java/org/embulk/config/ConfigException.java +0 -26
- data/embulk-core/src/main/java/org/embulk/config/ConfigInject.java +0 -14
- data/embulk-core/src/main/java/org/embulk/config/ConfigLoader.java +0 -149
- data/embulk-core/src/main/java/org/embulk/config/ConfigSource.java +0 -34
- data/embulk-core/src/main/java/org/embulk/config/DataSource.java +0 -41
- data/embulk-core/src/main/java/org/embulk/config/DataSourceImpl.java +0 -243
- data/embulk-core/src/main/java/org/embulk/config/DataSourceSerDe.java +0 -84
- data/embulk-core/src/main/java/org/embulk/config/GenericTypeReference.java +0 -20
- data/embulk-core/src/main/java/org/embulk/config/ModelManager.java +0 -123
- data/embulk-core/src/main/java/org/embulk/config/Task.java +0 -10
- data/embulk-core/src/main/java/org/embulk/config/TaskInvocationHandler.java +0 -180
- data/embulk-core/src/main/java/org/embulk/config/TaskReport.java +0 -32
- data/embulk-core/src/main/java/org/embulk/config/TaskSerDe.java +0 -349
- data/embulk-core/src/main/java/org/embulk/config/TaskSource.java +0 -34
- data/embulk-core/src/main/java/org/embulk/config/TaskValidationException.java +0 -38
- data/embulk-core/src/main/java/org/embulk/config/TaskValidator.java +0 -24
- data/embulk-core/src/main/java/org/embulk/config/UserDataException.java +0 -4
- data/embulk-core/src/main/java/org/embulk/config/UserDataExceptions.java +0 -17
- data/embulk-core/src/main/java/org/embulk/config/YamlTagResolver.java +0 -53
- data/embulk-core/src/main/java/org/embulk/exec/BufferFileInputPlugin.java +0 -88
- data/embulk-core/src/main/java/org/embulk/exec/BulkLoader.java +0 -754
- data/embulk-core/src/main/java/org/embulk/exec/ConfigurableGuessInputPlugin.java +0 -9
- data/embulk-core/src/main/java/org/embulk/exec/ExecModule.java +0 -53
- data/embulk-core/src/main/java/org/embulk/exec/ExecutionInterruptedException.java +0 -10
- data/embulk-core/src/main/java/org/embulk/exec/ExecutionResult.java +0 -33
- data/embulk-core/src/main/java/org/embulk/exec/ExtensionServiceLoaderModule.java +0 -43
- data/embulk-core/src/main/java/org/embulk/exec/ForGuess.java +0 -16
- data/embulk-core/src/main/java/org/embulk/exec/ForSystemConfig.java +0 -16
- data/embulk-core/src/main/java/org/embulk/exec/GuessExecutor.java +0 -309
- data/embulk-core/src/main/java/org/embulk/exec/LocalExecutorPlugin.java +0 -563
- data/embulk-core/src/main/java/org/embulk/exec/LoggerProvider.java +0 -68
- data/embulk-core/src/main/java/org/embulk/exec/NoSampleException.java +0 -10
- data/embulk-core/src/main/java/org/embulk/exec/PartialExecutionException.java +0 -26
- data/embulk-core/src/main/java/org/embulk/exec/PooledBufferAllocator.java +0 -77
- data/embulk-core/src/main/java/org/embulk/exec/PreviewExecutor.java +0 -222
- data/embulk-core/src/main/java/org/embulk/exec/PreviewResult.java +0 -27
- data/embulk-core/src/main/java/org/embulk/exec/PreviewedNoticeError.java +0 -17
- data/embulk-core/src/main/java/org/embulk/exec/ResumeState.java +0 -100
- data/embulk-core/src/main/java/org/embulk/exec/SamplingParserPlugin.java +0 -215
- data/embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java +0 -22
- data/embulk-core/src/main/java/org/embulk/exec/SkipTransactionException.java +0 -23
- data/embulk-core/src/main/java/org/embulk/exec/SystemConfigModule.java +0 -24
- data/embulk-core/src/main/java/org/embulk/exec/TempFileAllocator.java +0 -35
- data/embulk-core/src/main/java/org/embulk/exec/TransactionStage.java +0 -27
- data/embulk-core/src/main/java/org/embulk/jruby/JRubyPluginSource.java +0 -76
- data/embulk-core/src/main/java/org/embulk/jruby/JRubyScriptingModule.java +0 -395
- data/embulk-core/src/main/java/org/embulk/plugin/BuiltinPluginSourceModule.java +0 -17
- data/embulk-core/src/main/java/org/embulk/plugin/DefaultPluginType.java +0 -50
- data/embulk-core/src/main/java/org/embulk/plugin/InjectedPluginSource.java +0 -100
- data/embulk-core/src/main/java/org/embulk/plugin/MavenPluginType.java +0 -112
- data/embulk-core/src/main/java/org/embulk/plugin/PluginClassLoader.java +0 -993
- data/embulk-core/src/main/java/org/embulk/plugin/PluginClassLoaderFactory.java +0 -16
- data/embulk-core/src/main/java/org/embulk/plugin/PluginClassLoaderModule.java +0 -102
- data/embulk-core/src/main/java/org/embulk/plugin/PluginManager.java +0 -78
- data/embulk-core/src/main/java/org/embulk/plugin/PluginSource.java +0 -49
- data/embulk-core/src/main/java/org/embulk/plugin/PluginSourceNotMatchException.java +0 -25
- data/embulk-core/src/main/java/org/embulk/plugin/PluginType.java +0 -122
- data/embulk-core/src/main/java/org/embulk/plugin/compat/InputPluginWrapper.java +0 -102
- data/embulk-core/src/main/java/org/embulk/plugin/compat/PluginWrappers.java +0 -30
- data/embulk-core/src/main/java/org/embulk/plugin/compat/TransactionalFileInputWrapper.java +0 -96
- data/embulk-core/src/main/java/org/embulk/plugin/compat/TransactionalFileOutputWrapper.java +0 -102
- data/embulk-core/src/main/java/org/embulk/plugin/compat/TransactionalPageOutputWrapper.java +0 -95
- data/embulk-core/src/main/java/org/embulk/plugin/jar/InvalidJarPluginException.java +0 -14
- data/embulk-core/src/main/java/org/embulk/plugin/jar/JarPluginLoader.java +0 -232
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenArtifactFinder.java +0 -134
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenArtifactNotFoundException.java +0 -20
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenPluginSource.java +0 -187
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenPluginSourceModule.java +0 -22
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenRepositoryNotFoundException.java +0 -31
- data/embulk-core/src/main/java/org/embulk/spi/AbortTransactionResource.java +0 -36
- data/embulk-core/src/main/java/org/embulk/spi/Buffer.java +0 -148
- data/embulk-core/src/main/java/org/embulk/spi/BufferAllocator.java +0 -8
- data/embulk-core/src/main/java/org/embulk/spi/CloseResource.java +0 -42
- data/embulk-core/src/main/java/org/embulk/spi/Column.java +0 -95
- data/embulk-core/src/main/java/org/embulk/spi/ColumnConfig.java +0 -112
- data/embulk-core/src/main/java/org/embulk/spi/ColumnVisitor.java +0 -16
- data/embulk-core/src/main/java/org/embulk/spi/DataException.java +0 -23
- data/embulk-core/src/main/java/org/embulk/spi/DecoderPlugin.java +0 -16
- data/embulk-core/src/main/java/org/embulk/spi/EncoderPlugin.java +0 -16
- data/embulk-core/src/main/java/org/embulk/spi/Exec.java +0 -113
- data/embulk-core/src/main/java/org/embulk/spi/ExecAction.java +0 -6
- data/embulk-core/src/main/java/org/embulk/spi/ExecSession.java +0 -220
- data/embulk-core/src/main/java/org/embulk/spi/ExecutorPlugin.java +0 -19
- data/embulk-core/src/main/java/org/embulk/spi/Extension.java +0 -44
- data/embulk-core/src/main/java/org/embulk/spi/FileInput.java +0 -11
- data/embulk-core/src/main/java/org/embulk/spi/FileInputPlugin.java +0 -30
- data/embulk-core/src/main/java/org/embulk/spi/FileInputRunner.java +0 -169
- data/embulk-core/src/main/java/org/embulk/spi/FileOutput.java +0 -13
- data/embulk-core/src/main/java/org/embulk/spi/FileOutputPlugin.java +0 -28
- data/embulk-core/src/main/java/org/embulk/spi/FileOutputRunner.java +0 -199
- data/embulk-core/src/main/java/org/embulk/spi/FilterPlugin.java +0 -18
- data/embulk-core/src/main/java/org/embulk/spi/FormatterPlugin.java +0 -18
- data/embulk-core/src/main/java/org/embulk/spi/GuessPlugin.java +0 -9
- data/embulk-core/src/main/java/org/embulk/spi/InputPlugin.java +0 -33
- data/embulk-core/src/main/java/org/embulk/spi/OutputPlugin.java +0 -29
- data/embulk-core/src/main/java/org/embulk/spi/Page.java +0 -86
- data/embulk-core/src/main/java/org/embulk/spi/PageBuilder.java +0 -696
- data/embulk-core/src/main/java/org/embulk/spi/PageFormat.java +0 -47
- data/embulk-core/src/main/java/org/embulk/spi/PageOutput.java +0 -11
- data/embulk-core/src/main/java/org/embulk/spi/PageReader.java +0 -248
- data/embulk-core/src/main/java/org/embulk/spi/ParserPlugin.java +0 -17
- data/embulk-core/src/main/java/org/embulk/spi/ProcessState.java +0 -10
- data/embulk-core/src/main/java/org/embulk/spi/ProcessTask.java +0 -117
- data/embulk-core/src/main/java/org/embulk/spi/Schema.java +0 -139
- data/embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java +0 -93
- data/embulk-core/src/main/java/org/embulk/spi/SchemaConfigException.java +0 -22
- data/embulk-core/src/main/java/org/embulk/spi/TaskState.java +0 -81
- data/embulk-core/src/main/java/org/embulk/spi/TempFileException.java +0 -19
- data/embulk-core/src/main/java/org/embulk/spi/TempFileSpace.java +0 -88
- data/embulk-core/src/main/java/org/embulk/spi/Transactional.java +0 -10
- data/embulk-core/src/main/java/org/embulk/spi/TransactionalFileInput.java +0 -17
- data/embulk-core/src/main/java/org/embulk/spi/TransactionalFileOutput.java +0 -19
- data/embulk-core/src/main/java/org/embulk/spi/TransactionalPageOutput.java +0 -17
- data/embulk-core/src/main/java/org/embulk/spi/json/JsonParseException.java +0 -17
- data/embulk-core/src/main/java/org/embulk/spi/json/JsonParser.java +0 -233
- data/embulk-core/src/main/java/org/embulk/spi/json/RubyValueApi.java +0 -100
- data/embulk-core/src/main/java/org/embulk/spi/time/DateTimeZoneSerDe.java +0 -55
- data/embulk-core/src/main/java/org/embulk/spi/time/Timestamp.java +0 -180
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampFormat.java +0 -158
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampFormatter.java +0 -125
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampParseException.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampParser.java +0 -310
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampSerDe.java +0 -49
- data/embulk-core/src/main/java/org/embulk/spi/type/AbstractType.java +0 -58
- data/embulk-core/src/main/java/org/embulk/spi/type/BooleanType.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/type/DoubleType.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/type/JsonType.java +0 -14
- data/embulk-core/src/main/java/org/embulk/spi/type/LongType.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/type/StringType.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/type/TimestampType.java +0 -41
- data/embulk-core/src/main/java/org/embulk/spi/type/Type.java +0 -15
- data/embulk-core/src/main/java/org/embulk/spi/type/TypeDeserializer.java +0 -45
- data/embulk-core/src/main/java/org/embulk/spi/type/Types.java +0 -16
- data/embulk-core/src/main/java/org/embulk/spi/unit/ByteSize.java +0 -156
- data/embulk-core/src/main/java/org/embulk/spi/unit/LocalFile.java +0 -106
- data/embulk-core/src/main/java/org/embulk/spi/unit/LocalFileSerDe.java +0 -113
- data/embulk-core/src/main/java/org/embulk/spi/unit/ToString.java +0 -54
- data/embulk-core/src/main/java/org/embulk/spi/unit/ToStringMap.java +0 -34
- data/embulk-core/src/main/java/org/embulk/spi/util/CharsetSerDe.java +0 -55
- data/embulk-core/src/main/java/org/embulk/spi/util/Decoders.java +0 -81
- data/embulk-core/src/main/java/org/embulk/spi/util/DynamicColumnNotFoundException.java +0 -10
- data/embulk-core/src/main/java/org/embulk/spi/util/DynamicColumnSetter.java +0 -21
- data/embulk-core/src/main/java/org/embulk/spi/util/DynamicColumnSetterFactory.java +0 -134
- data/embulk-core/src/main/java/org/embulk/spi/util/DynamicPageBuilder.java +0 -200
- data/embulk-core/src/main/java/org/embulk/spi/util/Encoders.java +0 -81
- data/embulk-core/src/main/java/org/embulk/spi/util/Executors.java +0 -93
- data/embulk-core/src/main/java/org/embulk/spi/util/FileInputInputStream.java +0 -111
- data/embulk-core/src/main/java/org/embulk/spi/util/FileOutputOutputStream.java +0 -119
- data/embulk-core/src/main/java/org/embulk/spi/util/Filters.java +0 -100
- data/embulk-core/src/main/java/org/embulk/spi/util/InputStreamFileInput.java +0 -189
- data/embulk-core/src/main/java/org/embulk/spi/util/InputStreamTransactionalFileInput.java +0 -25
- data/embulk-core/src/main/java/org/embulk/spi/util/Inputs.java +0 -65
- data/embulk-core/src/main/java/org/embulk/spi/util/LineDecoder.java +0 -157
- data/embulk-core/src/main/java/org/embulk/spi/util/LineEncoder.java +0 -123
- data/embulk-core/src/main/java/org/embulk/spi/util/ListFileInput.java +0 -52
- data/embulk-core/src/main/java/org/embulk/spi/util/Newline.java +0 -38
- data/embulk-core/src/main/java/org/embulk/spi/util/OutputStreamFileOutput.java +0 -88
- data/embulk-core/src/main/java/org/embulk/spi/util/PagePrinter.java +0 -126
- data/embulk-core/src/main/java/org/embulk/spi/util/Pages.java +0 -149
- data/embulk-core/src/main/java/org/embulk/spi/util/ResumableInputStream.java +0 -168
- data/embulk-core/src/main/java/org/embulk/spi/util/RetryExecutor.java +0 -130
- data/embulk-core/src/main/java/org/embulk/spi/util/Timestamps.java +0 -53
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/AbstractDynamicColumnSetter.java +0 -94
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/BooleanColumnSetter.java +0 -71
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/DefaultValueSetter.java +0 -20
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/DoubleColumnSetter.java +0 -68
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java +0 -64
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/LongColumnSetter.java +0 -78
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/NullDefaultValueSetter.java +0 -39
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/SkipColumnSetter.java +0 -68
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java +0 -63
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/TimestampColumnSetter.java +0 -72
- data/embulk-core/src/main/resources/embulk/logback-color.xml +0 -72
- data/embulk-core/src/main/resources/embulk/logback-console.xml +0 -14
- data/embulk-core/src/main/resources/embulk/logback-file.xml +0 -23
- data/embulk-core/src/main/resources/embulk/parent_first_packages.properties +0 -73
- data/embulk-core/src/main/resources/embulk/parent_first_resources.properties +0 -29
- data/embulk-core/src/test/java/org/embulk/EmbulkTestRuntime.java +0 -122
- data/embulk-core/src/test/java/org/embulk/GuiceBinder.java +0 -72
- data/embulk-core/src/test/java/org/embulk/RandomManager.java +0 -53
- data/embulk-core/src/test/java/org/embulk/TestPluginSourceModule.java +0 -23
- data/embulk-core/src/test/java/org/embulk/TestUtilityModule.java +0 -17
- data/embulk-core/src/test/java/org/embulk/config/TestConfigLoader.java +0 -66
- data/embulk-core/src/test/java/org/embulk/config/TestConfigSource.java +0 -114
- data/embulk-core/src/test/java/org/embulk/config/TestTaskSource.java +0 -70
- data/embulk-core/src/test/java/org/embulk/plugin/MockPluginSource.java +0 -58
- data/embulk-core/src/test/java/org/embulk/plugin/TestPluginType.java +0 -83
- data/embulk-core/src/test/java/org/embulk/plugin/TestPluginTypeSerDe.java +0 -67
- data/embulk-core/src/test/java/org/embulk/plugin/jar/ExampleJarSpiV0.java +0 -9
- data/embulk-core/src/test/java/org/embulk/plugin/jar/JarBuilder.java +0 -101
- data/embulk-core/src/test/java/org/embulk/plugin/jar/TestJarPluginLoader.java +0 -60
- data/embulk-core/src/test/java/org/embulk/plugin/maven/TestMavenArtifactFinder.java +0 -41
- data/embulk-core/src/test/java/org/embulk/spi/MockFileOutput.java +0 -63
- data/embulk-core/src/test/java/org/embulk/spi/MockFormatterPlugin.java +0 -108
- data/embulk-core/src/test/java/org/embulk/spi/MockParserPlugin.java +0 -80
- data/embulk-core/src/test/java/org/embulk/spi/PageTestUtils.java +0 -59
- data/embulk-core/src/test/java/org/embulk/spi/TestBuffer.java +0 -24
- data/embulk-core/src/test/java/org/embulk/spi/TestFileInputInputStream.java +0 -89
- data/embulk-core/src/test/java/org/embulk/spi/TestFileInputRunner.java +0 -199
- data/embulk-core/src/test/java/org/embulk/spi/TestFileOutputRunner.java +0 -221
- data/embulk-core/src/test/java/org/embulk/spi/TestInputStreamFileInput.java +0 -188
- data/embulk-core/src/test/java/org/embulk/spi/TestPageBuilderReader.java +0 -411
- data/embulk-core/src/test/java/org/embulk/spi/json/TestJsonParser.java +0 -102
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestamp.java +0 -116
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestampFormatterParser.java +0 -75
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestampFormatterParserDeprecated.java +0 -67
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestampParser.java +0 -247
- data/embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java +0 -45
- data/embulk-core/src/test/java/org/embulk/spi/unit/TestByteSize.java +0 -79
- data/embulk-core/src/test/java/org/embulk/spi/util/TestLineDecoder.java +0 -237
- data/embulk-core/src/test/java/org/embulk/spi/util/TestLineEncoder.java +0 -123
- data/embulk-core/src/test/resources/m2.test/.gitignore +0 -1
- data/embulk-core/src/test/resources/m2.test/org/embulk/example/embulk-example-maven-artifact/0.1.2/embulk-example-maven-artifact-0.1.2.jar +0 -0
- data/embulk-core/src/test/resources/m2.test/org/embulk/example/embulk-example-maven-artifact/0.1.2/embulk-example-maven-artifact-0.1.2.jar.sha1 +0 -1
- data/embulk-core/src/test/resources/m2.test/org/embulk/example/embulk-example-maven-artifact/0.1.2/embulk-example-maven-artifact-0.1.2.pom +0 -9
- data/embulk-core/src/test/resources/m2.test/org/embulk/example/embulk-example-maven-artifact/0.1.2/embulk-example-maven-artifact-0.1.2.pom.sha1 +0 -1
- data/embulk-docs/Makefile +0 -178
- data/embulk-docs/build.gradle +0 -41
- data/embulk-docs/make.bat +0 -243
- data/embulk-docs/push-gh-pages.sh +0 -49
- data/embulk-docs/src/_static/embulk-architecture.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-oneline-tr.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-oneline-wt.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-oneline.ai +0 -396
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq-tr-small.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq-tr.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq-wt.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq.ai +0 -417
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq.svg +0 -1
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-symbol-tr.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-symbol-wt.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-symbol.ai +1 -394
- data/embulk-docs/src/_static/embulk-logo.svg +0 -133
- data/embulk-docs/src/built-in.rst +0 -1017
- data/embulk-docs/src/conf.py +0 -260
- data/embulk-docs/src/customization.rst +0 -184
- data/embulk-docs/src/developers/index.rst +0 -45
- data/embulk-docs/src/index.rst +0 -102
- data/embulk-docs/src/logo.rst +0 -27
- data/embulk-docs/src/recipe.rst +0 -8
- data/embulk-docs/src/recipe/scheduled-csv-load-to-elasticsearch-kibana5.rst +0 -163
- data/embulk-docs/src/release.rst +0 -109
- data/embulk-docs/src/release/release-0.1.0.rst +0 -8
- data/embulk-docs/src/release/release-0.2.0.rst +0 -16
- data/embulk-docs/src/release/release-0.2.1.rst +0 -19
- data/embulk-docs/src/release/release-0.3.0.rst +0 -34
- data/embulk-docs/src/release/release-0.3.1.rst +0 -11
- data/embulk-docs/src/release/release-0.3.2.rst +0 -15
- data/embulk-docs/src/release/release-0.4.0.rst +0 -74
- data/embulk-docs/src/release/release-0.4.1.rst +0 -18
- data/embulk-docs/src/release/release-0.4.10.rst +0 -17
- data/embulk-docs/src/release/release-0.4.2.rst +0 -18
- data/embulk-docs/src/release/release-0.4.3.rst +0 -34
- data/embulk-docs/src/release/release-0.4.4.rst +0 -39
- data/embulk-docs/src/release/release-0.4.5.rst +0 -24
- data/embulk-docs/src/release/release-0.4.6.rst +0 -30
- data/embulk-docs/src/release/release-0.4.7.rst +0 -16
- data/embulk-docs/src/release/release-0.4.8.rst +0 -15
- data/embulk-docs/src/release/release-0.4.9.rst +0 -23
- data/embulk-docs/src/release/release-0.5.0.rst +0 -89
- data/embulk-docs/src/release/release-0.5.1.rst +0 -13
- data/embulk-docs/src/release/release-0.5.2.rst +0 -30
- data/embulk-docs/src/release/release-0.5.3.rst +0 -22
- data/embulk-docs/src/release/release-0.5.4.rst +0 -24
- data/embulk-docs/src/release/release-0.5.5.rst +0 -18
- data/embulk-docs/src/release/release-0.6.0.rst +0 -34
- data/embulk-docs/src/release/release-0.6.1.rst +0 -11
- data/embulk-docs/src/release/release-0.6.10.rst +0 -15
- data/embulk-docs/src/release/release-0.6.11.rst +0 -19
- data/embulk-docs/src/release/release-0.6.12.rst +0 -31
- data/embulk-docs/src/release/release-0.6.13.rst +0 -23
- data/embulk-docs/src/release/release-0.6.14.rst +0 -47
- data/embulk-docs/src/release/release-0.6.15.rst +0 -26
- data/embulk-docs/src/release/release-0.6.16.rst +0 -26
- data/embulk-docs/src/release/release-0.6.17.rst +0 -39
- data/embulk-docs/src/release/release-0.6.18.rst +0 -14
- data/embulk-docs/src/release/release-0.6.19.rst +0 -18
- data/embulk-docs/src/release/release-0.6.2.rst +0 -17
- data/embulk-docs/src/release/release-0.6.20.rst +0 -19
- data/embulk-docs/src/release/release-0.6.21.rst +0 -20
- data/embulk-docs/src/release/release-0.6.22.rst +0 -26
- data/embulk-docs/src/release/release-0.6.23.rst +0 -17
- data/embulk-docs/src/release/release-0.6.24.rst +0 -13
- data/embulk-docs/src/release/release-0.6.25.rst +0 -12
- data/embulk-docs/src/release/release-0.6.26.rst +0 -17
- data/embulk-docs/src/release/release-0.6.27.rst +0 -11
- data/embulk-docs/src/release/release-0.6.3.rst +0 -23
- data/embulk-docs/src/release/release-0.6.4.rst +0 -13
- data/embulk-docs/src/release/release-0.6.5.rst +0 -17
- data/embulk-docs/src/release/release-0.6.6.rst +0 -17
- data/embulk-docs/src/release/release-0.6.7.rst +0 -17
- data/embulk-docs/src/release/release-0.6.8.rst +0 -24
- data/embulk-docs/src/release/release-0.6.9.rst +0 -24
- data/embulk-docs/src/release/release-0.7.0.rst +0 -96
- data/embulk-docs/src/release/release-0.7.1.rst +0 -22
- data/embulk-docs/src/release/release-0.7.10.rst +0 -13
- data/embulk-docs/src/release/release-0.7.11.rst +0 -12
- data/embulk-docs/src/release/release-0.7.2.rst +0 -25
- data/embulk-docs/src/release/release-0.7.3.rst +0 -21
- data/embulk-docs/src/release/release-0.7.4.rst +0 -14
- data/embulk-docs/src/release/release-0.7.5.rst +0 -22
- data/embulk-docs/src/release/release-0.7.6.rst +0 -18
- data/embulk-docs/src/release/release-0.7.7.rst +0 -13
- data/embulk-docs/src/release/release-0.7.8.rst +0 -14
- data/embulk-docs/src/release/release-0.7.9.rst +0 -14
- data/embulk-docs/src/release/release-0.8.0.rst +0 -74
- data/embulk-docs/src/release/release-0.8.1.rst +0 -18
- data/embulk-docs/src/release/release-0.8.10.rst +0 -35
- data/embulk-docs/src/release/release-0.8.11.rst +0 -12
- data/embulk-docs/src/release/release-0.8.12.rst +0 -12
- data/embulk-docs/src/release/release-0.8.13.rst +0 -12
- data/embulk-docs/src/release/release-0.8.14.rst +0 -31
- data/embulk-docs/src/release/release-0.8.15.rst +0 -17
- data/embulk-docs/src/release/release-0.8.16.rst +0 -43
- data/embulk-docs/src/release/release-0.8.17.rst +0 -11
- data/embulk-docs/src/release/release-0.8.18.rst +0 -27
- data/embulk-docs/src/release/release-0.8.19.rst +0 -43
- data/embulk-docs/src/release/release-0.8.2.rst +0 -19
- data/embulk-docs/src/release/release-0.8.20.rst +0 -11
- data/embulk-docs/src/release/release-0.8.21.rst +0 -17
- data/embulk-docs/src/release/release-0.8.22.rst +0 -15
- data/embulk-docs/src/release/release-0.8.23.rst +0 -14
- data/embulk-docs/src/release/release-0.8.24.rst +0 -15
- data/embulk-docs/src/release/release-0.8.25.rst +0 -14
- data/embulk-docs/src/release/release-0.8.26.rst +0 -16
- data/embulk-docs/src/release/release-0.8.27.rst +0 -15
- data/embulk-docs/src/release/release-0.8.28.rst +0 -14
- data/embulk-docs/src/release/release-0.8.29.rst +0 -14
- data/embulk-docs/src/release/release-0.8.3.rst +0 -15
- data/embulk-docs/src/release/release-0.8.30.rst +0 -14
- data/embulk-docs/src/release/release-0.8.31.rst +0 -12
- data/embulk-docs/src/release/release-0.8.32.rst +0 -14
- data/embulk-docs/src/release/release-0.8.33.rst +0 -13
- data/embulk-docs/src/release/release-0.8.34.rst +0 -12
- data/embulk-docs/src/release/release-0.8.35.rst +0 -12
- data/embulk-docs/src/release/release-0.8.36.rst +0 -32
- data/embulk-docs/src/release/release-0.8.37.rst +0 -20
- data/embulk-docs/src/release/release-0.8.38.rst +0 -12
- data/embulk-docs/src/release/release-0.8.39.rst +0 -12
- data/embulk-docs/src/release/release-0.8.4.rst +0 -18
- data/embulk-docs/src/release/release-0.8.5.rst +0 -11
- data/embulk-docs/src/release/release-0.8.6.rst +0 -14
- data/embulk-docs/src/release/release-0.8.7.rst +0 -18
- data/embulk-docs/src/release/release-0.8.8.rst +0 -18
- data/embulk-docs/src/release/release-0.8.9.rst +0 -14
- data/embulk-jruby-strptime/build.gradle +0 -3
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/RubyDateParser.java +0 -121
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/StrptimeFormat.java +0 -53
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/StrptimeParser.java +0 -884
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/StrptimeToken.java +0 -111
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/TimeZoneConverter.java +0 -466
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/lexer/StrptimeLexer.flex +0 -62
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/lexer/StrptimeLexer.java +0 -577
- data/embulk-standards/build.gradle +0 -7
- data/embulk-standards/src/main/java/org/embulk/standards/Bzip2FileDecoderPlugin.java +0 -55
- data/embulk-standards/src/main/java/org/embulk/standards/Bzip2FileEncoderPlugin.java +0 -67
- data/embulk-standards/src/main/java/org/embulk/standards/ConfigInputPlugin.java +0 -170
- data/embulk-standards/src/main/java/org/embulk/standards/CsvFormatterPlugin.java +0 -295
- data/embulk-standards/src/main/java/org/embulk/standards/CsvParserPlugin.java +0 -416
- data/embulk-standards/src/main/java/org/embulk/standards/CsvTokenizer.java +0 -545
- data/embulk-standards/src/main/java/org/embulk/standards/GzipFileDecoderPlugin.java +0 -55
- data/embulk-standards/src/main/java/org/embulk/standards/GzipFileEncoderPlugin.java +0 -71
- data/embulk-standards/src/main/java/org/embulk/standards/JsonParserPlugin.java +0 -235
- data/embulk-standards/src/main/java/org/embulk/standards/LocalFileInputPlugin.java +0 -232
- data/embulk-standards/src/main/java/org/embulk/standards/LocalFileOutputPlugin.java +0 -148
- data/embulk-standards/src/main/java/org/embulk/standards/NullOutputPlugin.java +0 -59
- data/embulk-standards/src/main/java/org/embulk/standards/RemoveColumnsFilterPlugin.java +0 -268
- data/embulk-standards/src/main/java/org/embulk/standards/RenameFilterPlugin.java +0 -479
- data/embulk-standards/src/main/java/org/embulk/standards/StandardPluginExtension.java +0 -16
- data/embulk-standards/src/main/java/org/embulk/standards/StandardPluginModule.java +0 -60
- data/embulk-standards/src/main/java/org/embulk/standards/StdoutOutputPlugin.java +0 -91
- data/embulk-standards/src/main/resources/META-INF/services/org.embulk.spi.Extension +0 -1
- data/embulk-standards/src/test/java/org/embulk/standards/TestCsvFormatterPlugin.java +0 -312
- data/embulk-standards/src/test/java/org/embulk/standards/TestCsvParserPlugin.java +0 -75
- data/embulk-standards/src/test/java/org/embulk/standards/TestCsvTokenizer.java +0 -457
- data/embulk-standards/src/test/java/org/embulk/standards/TestJsonParserPlugin.java +0 -351
- data/embulk-standards/src/test/java/org/embulk/standards/TestRemoveColumnsFilterPlugin.java +0 -121
- data/embulk-standards/src/test/java/org/embulk/standards/TestRenameFilterPlugin.java +0 -1020
- data/embulk-standards/src/test/java/org/embulk/standards/guess/TestCsvAllStringsGuessPlugin.java +0 -38
- data/embulk-standards/src/test/java/org/embulk/standards/guess/TestCsvGuessPlugin.java +0 -248
- data/embulk-standards/src/test/java/org/embulk/standards/preview/TestFilePreview.java +0 -73
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_and_header.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_and_header_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_and_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_with_trim_needed.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_with_trim_needed_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_with_trim_needed_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_with_trim_needed.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_with_trim_needed_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_with_trim_needed_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_and_header.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_and_header_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_and_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_int_single_column_rows.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_int_single_column_rows_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_int_single_column_rows_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_and_header.csv +0 -3
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_and_header_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_and_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_string_single_column_rows.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_string_single_column_rows_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_string_single_column_rows_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_backslash_escape.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_backslash_escape_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_backslash_escape_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_double_single_column.csv +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_double_single_column_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_double_single_column_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_with_header.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_with_header_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_with_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_semicolon_delimiter.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_semicolon_delimiter_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_semicolon_delimiter_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_simple.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_simple_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_simple_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_single_quote.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_single_quote_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_single_quote_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records_guessed.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_with_header.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_with_header_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_with_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_tab_delimiter.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_tab_delimiter_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_tab_delimiter_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv_all_strings/test/test_simple.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv_all_strings/test/test_simple_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv_all_strings/test/test_simple_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_exec.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_load.yml +0 -19
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_previewed.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple_load.yml +0 -19
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple_previewed.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_expected.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_filter.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_in.yml +0 -18
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_duplicated_column_names.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_duplicated_column_names.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_duplicated_column_names_expected.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_duplicated_column_names_in.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_unmatched_filter.yml +0 -3
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_without_unmatched_filter.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_expected.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_filter.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_in.yml +0 -18
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_with_unmatched_filter.yml +0 -3
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_without_unmatched_filter.yml +0 -2
- data/embulk-test/build.gradle +0 -6
- data/embulk-test/src/main/java/org/embulk/test/EmbulkTests.java +0 -75
- data/embulk-test/src/main/java/org/embulk/test/PreviewResultInputPlugin.java +0 -65
- data/embulk-test/src/main/java/org/embulk/test/TestingBulkLoader.java +0 -129
- data/embulk-test/src/main/java/org/embulk/test/TestingEmbulk.java +0 -710
- data/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/gradle/wrapper/gradle-wrapper.properties +0 -5
- data/gradlew +0 -172
- data/gradlew.bat +0 -84
- data/lib/embulk/data/bundle/.bundle/config +0 -3
- data/lib/embulk/data/bundle/.ruby-version +0 -1
- data/lib/embulk/data/bundle/Gemfile +0 -31
- data/lib/embulk/data/bundle/embulk/filter/example.rb +0 -42
- data/lib/embulk/data/bundle/embulk/input/example.rb +0 -54
- data/lib/embulk/data/bundle/embulk/output/example.rb +0 -58
- data/lib/embulk/data/new/LICENSE.txt +0 -21
- data/lib/embulk/data/new/README.md.vm +0 -106
- data/lib/embulk/data/new/gitignore.vm +0 -17
- data/lib/embulk/data/new/java/build.gradle.vm +0 -96
- data/lib/embulk/data/new/java/config/checkstyle/checkstyle.xml +0 -128
- data/lib/embulk/data/new/java/config/checkstyle/default.xml +0 -108
- data/lib/embulk/data/new/java/decoder.java.vm +0 -86
- data/lib/embulk/data/new/java/encoder.java.vm +0 -88
- data/lib/embulk/data/new/java/file_input.java.vm +0 -145
- data/lib/embulk/data/new/java/file_output.java.vm +0 -95
- data/lib/embulk/data/new/java/filter.java.vm +0 -57
- data/lib/embulk/data/new/java/formatter.java.vm +0 -55
- data/lib/embulk/data/new/java/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/lib/embulk/data/new/java/gradle/wrapper/gradle-wrapper.properties +0 -5
- data/lib/embulk/data/new/java/gradlew +0 -172
- data/lib/embulk/data/new/java/gradlew.bat +0 -84
- data/lib/embulk/data/new/java/input.java.vm +0 -89
- data/lib/embulk/data/new/java/output.java.vm +0 -79
- data/lib/embulk/data/new/java/parser.java.vm +0 -61
- data/lib/embulk/data/new/java/plugin_loader.rb.vm +0 -3
- data/lib/embulk/data/new/java/test.java.vm +0 -5
- data/lib/embulk/data/new/ruby/.ruby-version +0 -1
- data/lib/embulk/data/new/ruby/Gemfile +0 -2
- data/lib/embulk/data/new/ruby/Rakefile +0 -3
- data/lib/embulk/data/new/ruby/decoder_guess.rb.vm +0 -25
- data/lib/embulk/data/new/ruby/filter.rb.vm +0 -50
- data/lib/embulk/data/new/ruby/formatter.rb.vm +0 -49
- data/lib/embulk/data/new/ruby/gemspec.vm +0 -20
- data/lib/embulk/data/new/ruby/input.rb.vm +0 -59
- data/lib/embulk/data/new/ruby/output.rb.vm +0 -61
- data/lib/embulk/data/new/ruby/parser.rb.vm +0 -44
- data/lib/embulk/data/new/ruby/parser_guess.rb.vm +0 -65
- data/lib/embulk/data/package_data.rb +0 -59
- data/lib/embulk/runner.rb +0 -53
- data/settings.gradle +0 -8
- data/test/helper.rb +0 -23
- data/test/monkey_strptime/mri/date/test_date_strptime.rb +0 -515
- data/test/monkey_strptime/run-test.rb +0 -29
- data/test/vanilla/guess/test_csv_all_strings.rb +0 -43
- data/test/vanilla/guess/test_csv_guess.rb +0 -170
- data/test/vanilla/guess/test_schema_guess.rb +0 -47
- data/test/vanilla/guess/test_time_format_guess.rb +0 -135
- data/test/vanilla/run-test.rb +0 -14
- data/test/vanilla/time/test_timestamp_parser.rb +0 -117
@@ -1,17 +0,0 @@
|
|
1
|
-
package org.embulk.plugin;
|
2
|
-
|
3
|
-
import com.google.inject.Module;
|
4
|
-
import com.google.inject.Binder;
|
5
|
-
import com.google.inject.multibindings.Multibinder;
|
6
|
-
|
7
|
-
public class BuiltinPluginSourceModule
|
8
|
-
implements Module
|
9
|
-
{
|
10
|
-
@Override
|
11
|
-
public void configure(Binder binder)
|
12
|
-
{
|
13
|
-
Multibinder<PluginSource> multibinder = Multibinder.newSetBinder(binder, PluginSource.class);
|
14
|
-
//multibinder.addBinding().to(LocalDirectoryPluginSource.class); // TODO
|
15
|
-
multibinder.addBinding().to(InjectedPluginSource.class);
|
16
|
-
}
|
17
|
-
}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
package org.embulk.plugin;
|
2
|
-
|
3
|
-
import com.fasterxml.jackson.annotation.JsonValue;
|
4
|
-
import java.util.Objects;
|
5
|
-
|
6
|
-
public final class DefaultPluginType
|
7
|
-
extends PluginType
|
8
|
-
{
|
9
|
-
private DefaultPluginType(final String name)
|
10
|
-
{
|
11
|
-
super("default", name);
|
12
|
-
}
|
13
|
-
|
14
|
-
public static PluginType create(final String name)
|
15
|
-
{
|
16
|
-
if (name == null) {
|
17
|
-
throw new NullPointerException("name must not be null");
|
18
|
-
}
|
19
|
-
return new DefaultPluginType(name);
|
20
|
-
}
|
21
|
-
|
22
|
-
@JsonValue
|
23
|
-
public final String getJsonValue()
|
24
|
-
{
|
25
|
-
return this.getName();
|
26
|
-
}
|
27
|
-
|
28
|
-
@Override
|
29
|
-
public final int hashCode()
|
30
|
-
{
|
31
|
-
return Objects.hash(getSourceType(), getName());
|
32
|
-
}
|
33
|
-
|
34
|
-
@Override
|
35
|
-
public final boolean equals(final Object objectOther)
|
36
|
-
{
|
37
|
-
if (!(objectOther instanceof DefaultPluginType)) {
|
38
|
-
return false;
|
39
|
-
}
|
40
|
-
final DefaultPluginType other = (DefaultPluginType) objectOther;
|
41
|
-
return (this.getSourceType().equals(other.getSourceType()) &&
|
42
|
-
this.getName().equals(other.getName()));
|
43
|
-
}
|
44
|
-
|
45
|
-
@Override
|
46
|
-
public final String toString()
|
47
|
-
{
|
48
|
-
return this.getName();
|
49
|
-
}
|
50
|
-
}
|
@@ -1,100 +0,0 @@
|
|
1
|
-
package org.embulk.plugin;
|
2
|
-
|
3
|
-
import com.google.inject.Binder;
|
4
|
-
import com.google.inject.Inject;
|
5
|
-
import com.google.inject.Injector;
|
6
|
-
import com.google.inject.Key;
|
7
|
-
import com.google.inject.name.Names;
|
8
|
-
import com.google.inject.name.Named;
|
9
|
-
import com.google.common.base.Preconditions;
|
10
|
-
import org.embulk.spi.InputPlugin;
|
11
|
-
import org.embulk.spi.FileInputPlugin;
|
12
|
-
import org.embulk.spi.FileInputRunner;
|
13
|
-
import org.embulk.spi.OutputPlugin;
|
14
|
-
import org.embulk.spi.FileOutputPlugin;
|
15
|
-
import org.embulk.spi.FileOutputRunner;
|
16
|
-
|
17
|
-
/**
|
18
|
-
* InjectedPluginSource loads plugins bound by Guice.
|
19
|
-
* This plugin source is intended to be used in test cases.
|
20
|
-
* Plugins need to be bound to Binder following:
|
21
|
-
*
|
22
|
-
* // Module
|
23
|
-
* public void configure(Binder binder)
|
24
|
-
* {
|
25
|
-
* InjectedPluginSource.registerPluginTo(InputPluginclass, "my", MyInputPlugin.class);
|
26
|
-
* }
|
27
|
-
*
|
28
|
-
*/
|
29
|
-
public class InjectedPluginSource
|
30
|
-
implements PluginSource
|
31
|
-
{
|
32
|
-
private final Injector injector;
|
33
|
-
|
34
|
-
@Inject
|
35
|
-
public InjectedPluginSource(Injector injector)
|
36
|
-
{
|
37
|
-
this.injector = injector;
|
38
|
-
}
|
39
|
-
|
40
|
-
private static interface PluginFactory <T>
|
41
|
-
{
|
42
|
-
public T newPlugin(Injector injector);
|
43
|
-
}
|
44
|
-
|
45
|
-
public <T> T newPlugin(Class<T> iface, PluginType type) throws PluginSourceNotMatchException
|
46
|
-
{
|
47
|
-
if (type.getSourceType() != PluginSource.Type.DEFAULT) {
|
48
|
-
throw new PluginSourceNotMatchException();
|
49
|
-
}
|
50
|
-
|
51
|
-
final String name = type.getName();
|
52
|
-
try {
|
53
|
-
@SuppressWarnings("unchecked")
|
54
|
-
PluginFactory<T> factory = (PluginFactory<T>) injector.getInstance(
|
55
|
-
Key.get(PluginFactory.class, pluginFactoryName(iface, name)));
|
56
|
-
return factory.newPlugin(injector);
|
57
|
-
} catch (com.google.inject.ConfigurationException ex) {
|
58
|
-
throw new PluginSourceNotMatchException();
|
59
|
-
}
|
60
|
-
}
|
61
|
-
|
62
|
-
public static <T> void registerPluginTo(Binder binder, Class<T> iface, String name, final Class<?> impl)
|
63
|
-
{
|
64
|
-
PluginFactory<T> factory;
|
65
|
-
if (FileInputPlugin.class.isAssignableFrom(impl)) {
|
66
|
-
Preconditions.checkArgument(InputPlugin.class.equals(iface));
|
67
|
-
factory = new PluginFactory<T>() {
|
68
|
-
@SuppressWarnings("unchecked")
|
69
|
-
public T newPlugin(Injector injector)
|
70
|
-
{
|
71
|
-
return (T) new FileInputRunner((FileInputPlugin) injector.getInstance(impl));
|
72
|
-
}
|
73
|
-
};
|
74
|
-
} else if (FileOutputPlugin.class.isAssignableFrom(impl)) {
|
75
|
-
Preconditions.checkArgument(OutputPlugin.class.equals(iface));
|
76
|
-
factory = new PluginFactory<T>() {
|
77
|
-
@SuppressWarnings("unchecked")
|
78
|
-
public T newPlugin(Injector injector)
|
79
|
-
{
|
80
|
-
return (T) new FileOutputRunner((FileOutputPlugin) injector.getInstance(impl));
|
81
|
-
}
|
82
|
-
};
|
83
|
-
} else {
|
84
|
-
Preconditions.checkArgument(iface.isAssignableFrom(impl));
|
85
|
-
factory = new PluginFactory<T>() {
|
86
|
-
@SuppressWarnings("unchecked")
|
87
|
-
public T newPlugin(Injector injector)
|
88
|
-
{
|
89
|
-
return (T) injector.getInstance(impl);
|
90
|
-
}
|
91
|
-
};
|
92
|
-
}
|
93
|
-
binder.bind(PluginFactory.class).annotatedWith(pluginFactoryName(iface, name)).toInstance(factory);
|
94
|
-
}
|
95
|
-
|
96
|
-
private static Named pluginFactoryName(Class<?> iface, String name)
|
97
|
-
{
|
98
|
-
return Names.named(iface.getName() + "." + name);
|
99
|
-
}
|
100
|
-
}
|
@@ -1,112 +0,0 @@
|
|
1
|
-
package org.embulk.plugin;
|
2
|
-
|
3
|
-
import com.fasterxml.jackson.annotation.JsonProperty;
|
4
|
-
import com.fasterxml.jackson.annotation.JsonValue;
|
5
|
-
import java.util.Collections;
|
6
|
-
import java.util.HashMap;
|
7
|
-
import java.util.Map;
|
8
|
-
import java.util.Objects;
|
9
|
-
|
10
|
-
public final class MavenPluginType
|
11
|
-
extends PluginType
|
12
|
-
{
|
13
|
-
private MavenPluginType(final String name, final String group, final String classifier, final String version)
|
14
|
-
{
|
15
|
-
super("maven", name);
|
16
|
-
this.group = group;
|
17
|
-
this.classifier = classifier;
|
18
|
-
this.version = version;
|
19
|
-
|
20
|
-
final StringBuilder fullNameBuilder = new StringBuilder();
|
21
|
-
fullNameBuilder.append("maven:");
|
22
|
-
fullNameBuilder.append(group);
|
23
|
-
fullNameBuilder.append(":");
|
24
|
-
fullNameBuilder.append(name);
|
25
|
-
fullNameBuilder.append(":");
|
26
|
-
fullNameBuilder.append(version);
|
27
|
-
if (classifier != null) {
|
28
|
-
fullNameBuilder.append(":");
|
29
|
-
fullNameBuilder.append(classifier);
|
30
|
-
}
|
31
|
-
this.fullName = fullNameBuilder.toString();
|
32
|
-
|
33
|
-
final HashMap<String, String> fullMapMutable = new HashMap<String, String>();
|
34
|
-
fullMapMutable.put("source", "maven");
|
35
|
-
fullMapMutable.put("name", name);
|
36
|
-
fullMapMutable.put("group", group);
|
37
|
-
fullMapMutable.put("version", version);
|
38
|
-
this.fullMap = Collections.unmodifiableMap(fullMapMutable);
|
39
|
-
}
|
40
|
-
|
41
|
-
public static MavenPluginType create(
|
42
|
-
final String name, final String group, final String classifier, final String version)
|
43
|
-
{
|
44
|
-
if (name == null || group == null || version == null) {
|
45
|
-
throw new NullPointerException("\"name\", \"group\" and \"version\" must be present.");
|
46
|
-
}
|
47
|
-
return new MavenPluginType(name, group, classifier, version);
|
48
|
-
}
|
49
|
-
|
50
|
-
@JsonValue
|
51
|
-
public final Map<String, String> getJsonValue()
|
52
|
-
{
|
53
|
-
return this.fullMap;
|
54
|
-
}
|
55
|
-
|
56
|
-
@JsonProperty("group")
|
57
|
-
public final String getGroup()
|
58
|
-
{
|
59
|
-
return this.group;
|
60
|
-
}
|
61
|
-
|
62
|
-
@JsonProperty("classifier")
|
63
|
-
public final String getClassifier()
|
64
|
-
{
|
65
|
-
return this.classifier;
|
66
|
-
}
|
67
|
-
|
68
|
-
@JsonProperty("version")
|
69
|
-
public final String getVersion()
|
70
|
-
{
|
71
|
-
return this.version;
|
72
|
-
}
|
73
|
-
|
74
|
-
public final String getFullName()
|
75
|
-
{
|
76
|
-
return this.fullName;
|
77
|
-
}
|
78
|
-
|
79
|
-
@Override
|
80
|
-
public final int hashCode()
|
81
|
-
{
|
82
|
-
return Objects.hash(getSourceType(), getName(), this.group, this.classifier, this.version);
|
83
|
-
}
|
84
|
-
|
85
|
-
@Override
|
86
|
-
public boolean equals(Object objectOther)
|
87
|
-
{
|
88
|
-
if (!(objectOther instanceof MavenPluginType)) {
|
89
|
-
return false;
|
90
|
-
}
|
91
|
-
MavenPluginType other = (MavenPluginType) objectOther;
|
92
|
-
return (this.getSourceType().equals(other.getSourceType()) &&
|
93
|
-
this.getName().equals(other.getName()) &&
|
94
|
-
this.getGroup().equals(other.getGroup()) &&
|
95
|
-
((this.getClassifier() == null && other.getClassifier() == null) ||
|
96
|
-
(this.getClassifier() != null && this.getClassifier().equals(other.getClassifier()))) &&
|
97
|
-
this.getVersion().equals(other.getVersion()));
|
98
|
-
}
|
99
|
-
|
100
|
-
@JsonValue
|
101
|
-
@Override
|
102
|
-
public String toString()
|
103
|
-
{
|
104
|
-
return this.fullName;
|
105
|
-
}
|
106
|
-
|
107
|
-
private final String group;
|
108
|
-
private final String classifier; // |classifier| can be null.
|
109
|
-
private final String version;
|
110
|
-
private final String fullName;
|
111
|
-
private final Map<String, String> fullMap;
|
112
|
-
}
|
@@ -1,993 +0,0 @@
|
|
1
|
-
package org.embulk.plugin;
|
2
|
-
|
3
|
-
import com.google.common.base.Function;
|
4
|
-
import com.google.common.collect.ImmutableList;
|
5
|
-
import com.google.common.collect.Iterables;
|
6
|
-
import com.google.common.collect.Iterators;
|
7
|
-
import java.io.ByteArrayOutputStream;
|
8
|
-
import java.io.InputStream;
|
9
|
-
import java.io.IOException;
|
10
|
-
import java.net.JarURLConnection;
|
11
|
-
import java.net.MalformedURLException;
|
12
|
-
import java.net.URL;
|
13
|
-
import java.net.URLClassLoader;
|
14
|
-
import java.net.URLConnection;
|
15
|
-
import java.net.URLStreamHandler;
|
16
|
-
import java.nio.file.Path;
|
17
|
-
import java.security.AccessControlContext;
|
18
|
-
import java.security.AccessController;
|
19
|
-
import java.security.CodeSigner;
|
20
|
-
import java.security.CodeSource;
|
21
|
-
import java.security.PrivilegedActionException;
|
22
|
-
import java.security.PrivilegedExceptionAction;
|
23
|
-
import java.util.ArrayList;
|
24
|
-
import java.util.Collection;
|
25
|
-
import java.util.Collections;
|
26
|
-
import java.util.Enumeration;
|
27
|
-
import java.util.Iterator;
|
28
|
-
import java.util.List;
|
29
|
-
import java.util.Vector;
|
30
|
-
import java.util.jar.Attributes;
|
31
|
-
import java.util.jar.JarEntry;
|
32
|
-
import java.util.jar.JarInputStream;
|
33
|
-
import java.util.jar.Manifest;
|
34
|
-
|
35
|
-
public class PluginClassLoader
|
36
|
-
extends URLClassLoader
|
37
|
-
{
|
38
|
-
private PluginClassLoader(
|
39
|
-
final ClassLoader parentClassLoader,
|
40
|
-
final URL oneNestedJarFileUrl,
|
41
|
-
final Collection<String> embeddedJarPathsInNestedJar,
|
42
|
-
final Collection<URL> flatJarUrls,
|
43
|
-
final Collection<String> parentFirstPackages,
|
44
|
-
final Collection<String> parentFirstResources)
|
45
|
-
{
|
46
|
-
super(combineUrlsToArray(oneNestedJarFileUrl, flatJarUrls == null ? Collections.<URL>emptyList() : flatJarUrls),
|
47
|
-
parentClassLoader);
|
48
|
-
|
49
|
-
// Given |oneNestedJarFileUrl| should be "file:...". |this.oneNestedJarUrlBase| should be "jar:file:...".
|
50
|
-
URL oneNestedJarUrlBaseBuilt = null;
|
51
|
-
if (oneNestedJarFileUrl != null) {
|
52
|
-
try {
|
53
|
-
oneNestedJarUrlBaseBuilt = new URL("jar", "", -1, oneNestedJarFileUrl + "!/");
|
54
|
-
}
|
55
|
-
catch (MalformedURLException ex) {
|
56
|
-
// TODO: Notify this to reporters as far as possible.
|
57
|
-
System.err.println("FATAL: Invalid JAR file URL: " + oneNestedJarFileUrl.toString());
|
58
|
-
ex.printStackTrace();
|
59
|
-
}
|
60
|
-
}
|
61
|
-
this.oneNestedJarUrlBase = oneNestedJarUrlBaseBuilt;
|
62
|
-
|
63
|
-
if (embeddedJarPathsInNestedJar == null) {
|
64
|
-
this.embeddedJarPathsInNestedJar = Collections.<String>emptyList();
|
65
|
-
}
|
66
|
-
else {
|
67
|
-
this.embeddedJarPathsInNestedJar = Collections.unmodifiableCollection(embeddedJarPathsInNestedJar);
|
68
|
-
}
|
69
|
-
this.parentFirstPackagePrefixes = ImmutableList.copyOf(
|
70
|
-
Iterables.transform(parentFirstPackages, new Function<String, String>() {
|
71
|
-
public String apply(String pkg)
|
72
|
-
{
|
73
|
-
return pkg + ".";
|
74
|
-
}
|
75
|
-
}));
|
76
|
-
this.parentFirstResourcePrefixes = ImmutableList.copyOf(
|
77
|
-
Iterables.transform(parentFirstResources, new Function<String, String>() {
|
78
|
-
public String apply(String pkg)
|
79
|
-
{
|
80
|
-
return pkg + "/";
|
81
|
-
}
|
82
|
-
}));
|
83
|
-
this.accessControlContext = AccessController.getContext();
|
84
|
-
}
|
85
|
-
|
86
|
-
@Deprecated // Constructing directly with the constructor is deprecated (no warnings). Use static creator methods.
|
87
|
-
public PluginClassLoader(
|
88
|
-
final Collection<URL> flatJarUrls,
|
89
|
-
final ClassLoader parentClassLoader,
|
90
|
-
final Collection<String> parentFirstPackages,
|
91
|
-
final Collection<String> parentFirstResources)
|
92
|
-
{
|
93
|
-
this(parentClassLoader, null, null, flatJarUrls, parentFirstPackages, parentFirstResources);
|
94
|
-
}
|
95
|
-
|
96
|
-
/**
|
97
|
-
* Creates PluginClassLoader for plugins with dependency JARs flat on the file system, like Gem-based plugins.
|
98
|
-
*/
|
99
|
-
public static PluginClassLoader createForFlatJars(
|
100
|
-
final ClassLoader parentClassLoader,
|
101
|
-
final Collection<URL> flatJarUrls,
|
102
|
-
final Collection<String> parentFirstPackages,
|
103
|
-
final Collection<String> parentFirstResources)
|
104
|
-
{
|
105
|
-
return new PluginClassLoader(
|
106
|
-
parentClassLoader,
|
107
|
-
null,
|
108
|
-
null,
|
109
|
-
flatJarUrls,
|
110
|
-
parentFirstPackages,
|
111
|
-
parentFirstResources);
|
112
|
-
}
|
113
|
-
|
114
|
-
/**
|
115
|
-
* Creates PluginClassLoader for plugins with dependency JARs embedded in the plugin JAR itself.
|
116
|
-
*
|
117
|
-
* @param parentClassLoader the parent ClassLoader of this PluginClassLoader instance
|
118
|
-
* @param oneNestedJarFileUrl "file:" URL of the plugin JAR file
|
119
|
-
* @param embeddedJarPathsInNestedJar collection of resource names of embedded dependency JARs in the plugin JAR
|
120
|
-
* @param parentFirstPackages collection of package names that are to be loaded first before the plugin's
|
121
|
-
* @param parentFirstResources collection of resource names that are to be loaded first before the plugin's
|
122
|
-
*/
|
123
|
-
public static PluginClassLoader createForNestedJar(
|
124
|
-
final ClassLoader parentClassLoader,
|
125
|
-
final URL oneNestedJarFileUrl,
|
126
|
-
final Collection<String> embeddedJarPathsInNestedJar,
|
127
|
-
final Collection<String> parentFirstPackages,
|
128
|
-
final Collection<String> parentFirstResources)
|
129
|
-
{
|
130
|
-
return new PluginClassLoader(
|
131
|
-
parentClassLoader,
|
132
|
-
oneNestedJarFileUrl,
|
133
|
-
embeddedJarPathsInNestedJar,
|
134
|
-
null,
|
135
|
-
parentFirstPackages,
|
136
|
-
parentFirstResources);
|
137
|
-
}
|
138
|
-
|
139
|
-
/**
|
140
|
-
* Adds the specified path to the list of URLs (for {@code URLClassLoader}) to search for classes and resources.
|
141
|
-
*
|
142
|
-
* It internally calls {@code URLClassLoader#addURL}.
|
143
|
-
*
|
144
|
-
* Some plugins (embulk-input-jdbc, for example) are calling this method to load external JAR files.
|
145
|
-
*
|
146
|
-
* @see <a href="https://github.com/embulk/embulk-input-jdbc/blob/ebfff0b249d507fc730c87e08b56e6aa492060ca/embulk-input-jdbc/src/main/java/org/embulk/input/jdbc/AbstractJdbcInputPlugin.java#L586-L595">embulk-input-jdbc</a>
|
147
|
-
*/
|
148
|
-
public void addPath(Path path)
|
149
|
-
{
|
150
|
-
try {
|
151
|
-
addUrl(path.toUri().toURL());
|
152
|
-
} catch (MalformedURLException ex) {
|
153
|
-
throw new IllegalArgumentException(ex);
|
154
|
-
}
|
155
|
-
}
|
156
|
-
|
157
|
-
public void addUrl(URL url)
|
158
|
-
{
|
159
|
-
super.addURL(url);
|
160
|
-
}
|
161
|
-
|
162
|
-
/**
|
163
|
-
* Finds a class defined by the given name from given JARs and JARs in the given JAR.
|
164
|
-
*
|
165
|
-
* Classes directly inthe given JARs are always prioritized. Only if no such a class is found
|
166
|
-
* directly in the given JAR, it tries to find the class in JARs in the given JAR.
|
167
|
-
*/
|
168
|
-
@Override
|
169
|
-
protected Class<?> findClass(final String className)
|
170
|
-
throws ClassNotFoundException
|
171
|
-
{
|
172
|
-
if (this.oneNestedJarUrlBase == null || this.embeddedJarPathsInNestedJar.isEmpty()) {
|
173
|
-
// Multiple flat JARs -- Gem-based plugins, or Single JAR (JAR-based plugins) without any embedded JAR
|
174
|
-
return super.findClass(className);
|
175
|
-
}
|
176
|
-
else {
|
177
|
-
// Single nested JAR -- JAR-based plugins
|
178
|
-
try {
|
179
|
-
// Classes directly in the plugin JAR are always prioritized.
|
180
|
-
return super.findClass(className);
|
181
|
-
}
|
182
|
-
catch (ClassNotFoundException directClassNotFoundException) {
|
183
|
-
try {
|
184
|
-
return AccessController.doPrivileged(
|
185
|
-
new PrivilegedExceptionAction<Class<?>>() {
|
186
|
-
public Class<?> run()
|
187
|
-
throws ClassNotFoundException
|
188
|
-
{
|
189
|
-
try {
|
190
|
-
return defineClassFromEmbeddedJars(className);
|
191
|
-
}
|
192
|
-
catch (ClassNotFoundException | LinkageError | ClassCastException ex) {
|
193
|
-
throw ex;
|
194
|
-
}
|
195
|
-
catch (Throwable ex) {
|
196
|
-
// Resource found from JARs in the JAR, but failed to load it as a class.
|
197
|
-
throw new ClassNotFoundException(className, ex);
|
198
|
-
}
|
199
|
-
}
|
200
|
-
}, this.accessControlContext);
|
201
|
-
} catch (PrivilegedActionException ex) {
|
202
|
-
final Throwable internalException = ex.getException();
|
203
|
-
if (internalException instanceof ClassNotFoundException) {
|
204
|
-
throw (ClassNotFoundException) internalException;
|
205
|
-
}
|
206
|
-
if (internalException instanceof LinkageError) {
|
207
|
-
throw (LinkageError) internalException;
|
208
|
-
}
|
209
|
-
if (internalException instanceof ClassCastException) {
|
210
|
-
throw (ClassCastException) internalException;
|
211
|
-
}
|
212
|
-
throw new ClassNotFoundException(className, ex);
|
213
|
-
}
|
214
|
-
}
|
215
|
-
}
|
216
|
-
}
|
217
|
-
|
218
|
-
/**
|
219
|
-
* Loads the class with the specified binary name prioritized by the "parent-first" condition.
|
220
|
-
*
|
221
|
-
* It copy-cats {@code ClassLoader#loadClass} while the "parent-first" priorities are considered.
|
222
|
-
*
|
223
|
-
* If the specified class is "parent-first", it behaves the same as {@code ClassLoader#loadClass} ordered as below.
|
224
|
-
*
|
225
|
-
* <ol>
|
226
|
-
*
|
227
|
-
* <li><p>Invoke the {@code #findLoadedClass} method to check if the class has already been loaded.</p></li>
|
228
|
-
*
|
229
|
-
* <li><p>Invoke the parent's {@code #loadClass} method.
|
230
|
-
*
|
231
|
-
* <li><p>Invoke the {@code #findClass} method of this class loader to find the class.</p></li>
|
232
|
-
*
|
233
|
-
* </ol>
|
234
|
-
*
|
235
|
-
* If the specified class is "NOT parent-first", the 2nd and 3rd actions are swapped.
|
236
|
-
*
|
237
|
-
* @see <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String,%20boolean)">Oracle Java7's ClassLoader#loadClass</a>
|
238
|
-
* @see <a href="http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/jdk7u141-b02/src/share/classes/java/lang/ClassLoader.java">OpenJDK7's ClassLoader</a>
|
239
|
-
*/
|
240
|
-
@Override
|
241
|
-
protected Class<?> loadClass(String name, boolean resolve)
|
242
|
-
throws ClassNotFoundException
|
243
|
-
{
|
244
|
-
synchronized (getClassLoadingLock(name)) {
|
245
|
-
// If the class has already been loaded by this {@code ClassLoader} or the parent's {@code ClassLoader},
|
246
|
-
// find the loaded class and return it.
|
247
|
-
final Class<?> loadedClass = findLoadedClass(name);
|
248
|
-
|
249
|
-
if (loadedClass != null) {
|
250
|
-
return resolveClass(loadedClass, resolve);
|
251
|
-
}
|
252
|
-
|
253
|
-
final boolean parentFirst = isParentFirstPackage(name);
|
254
|
-
|
255
|
-
// If the class is "not parent-first" (not to be loaded by the parent at first),
|
256
|
-
// try {@code #findClass} of the child's ({@code PluginClassLoader}'s).
|
257
|
-
if (!parentFirst) {
|
258
|
-
try {
|
259
|
-
return resolveClass(findClass(name), resolve);
|
260
|
-
} catch (ClassNotFoundException ignored) {
|
261
|
-
}
|
262
|
-
}
|
263
|
-
|
264
|
-
// If the class is "parent-first" (to be loaded by the parent at first), try this part at first.
|
265
|
-
// If the class is "not parent-first" (not to be loaded by the parent at first), the above part runs first.
|
266
|
-
try {
|
267
|
-
return resolveClass(getParent().loadClass(name), resolve);
|
268
|
-
} catch (ClassNotFoundException ignored) {
|
269
|
-
}
|
270
|
-
|
271
|
-
// If the class is "parent-first" (to be loaded by the parent at first), this part runs after the above.
|
272
|
-
if (parentFirst) {
|
273
|
-
return resolveClass(findClass(name), resolve);
|
274
|
-
}
|
275
|
-
|
276
|
-
throw new ClassNotFoundException(name);
|
277
|
-
}
|
278
|
-
}
|
279
|
-
|
280
|
-
private Class<?> resolveClass(Class<?> clazz, boolean resolve)
|
281
|
-
{
|
282
|
-
if (resolve) {
|
283
|
-
resolveClass(clazz);
|
284
|
-
}
|
285
|
-
return clazz;
|
286
|
-
}
|
287
|
-
|
288
|
-
/**
|
289
|
-
* Finds a resource recognized as the given name from given JARs and JARs in the given JAR.
|
290
|
-
*
|
291
|
-
* Resources directly in the given JARs are always prioritized. Only if no such a resource is found
|
292
|
-
* directly in the given JAR, it tries to find the resource in JARs in the given JAR.
|
293
|
-
*
|
294
|
-
* Note that URLClassLoader#findResource is public while ClassLoader#findResource is protected.
|
295
|
-
*/
|
296
|
-
@Override
|
297
|
-
public URL findResource(final String resourceName)
|
298
|
-
{
|
299
|
-
if (this.oneNestedJarUrlBase == null || this.embeddedJarPathsInNestedJar.isEmpty()) {
|
300
|
-
// Multiple flat JARs -- Gem-based plugins, or Single JAR (JAR-based plugins) without any embedded JAR
|
301
|
-
return super.findResource(resourceName);
|
302
|
-
}
|
303
|
-
else {
|
304
|
-
// Single nested JAR -- JAR-based plugins
|
305
|
-
// Classes directly in the plugin JAR are always prioritized.
|
306
|
-
final URL rootUrl = super.findResource(resourceName);
|
307
|
-
if (rootUrl != null) {
|
308
|
-
return rootUrl;
|
309
|
-
}
|
310
|
-
|
311
|
-
try {
|
312
|
-
return AccessController.doPrivileged(
|
313
|
-
new PrivilegedExceptionAction<URL>() {
|
314
|
-
public URL run()
|
315
|
-
{
|
316
|
-
return findResourceFromEmbeddedJars(resourceName);
|
317
|
-
}
|
318
|
-
}, this.accessControlContext);
|
319
|
-
} catch (PrivilegedActionException ignored) {
|
320
|
-
}
|
321
|
-
|
322
|
-
return null;
|
323
|
-
}
|
324
|
-
}
|
325
|
-
|
326
|
-
/**
|
327
|
-
* Finds resources recognized as the given name from given JARs and JARs in the given JAR.
|
328
|
-
*
|
329
|
-
* Resources directly in the given JARs precede. Resources in JARs in the given JAR follow resources
|
330
|
-
* directly in the given JARs.
|
331
|
-
*
|
332
|
-
* Note that URLClassLoader#findResources is public while ClassLoader#findResources is protected.
|
333
|
-
*/
|
334
|
-
@Override
|
335
|
-
public Enumeration<URL> findResources(final String resourceName)
|
336
|
-
throws IOException
|
337
|
-
{
|
338
|
-
if (this.oneNestedJarUrlBase == null || this.embeddedJarPathsInNestedJar.isEmpty()) {
|
339
|
-
// Multiple flat JARs -- Gem-based plugins, or Single JAR (JAR-based plugins) without any embedded JAR
|
340
|
-
return super.findResources(resourceName);
|
341
|
-
}
|
342
|
-
else {
|
343
|
-
// Single nested JAR -- JAR-based plugins
|
344
|
-
final Vector<URL> urls = new Vector<URL>();
|
345
|
-
|
346
|
-
// Classes directly in the plugin JAR are always prioritized.
|
347
|
-
// Note that |super.findResources| may throw IOException.
|
348
|
-
for (final Enumeration<URL> rootUrls = super.findResources(resourceName); rootUrls.hasMoreElements(); ) {
|
349
|
-
urls.add(rootUrls.nextElement());
|
350
|
-
}
|
351
|
-
|
352
|
-
try {
|
353
|
-
final List<URL> childUrls = AccessController.doPrivileged(
|
354
|
-
new PrivilegedExceptionAction<List<URL>>() {
|
355
|
-
public List<URL> run()
|
356
|
-
throws IOException
|
357
|
-
{
|
358
|
-
return findResourcesFromEmbeddedJars(resourceName);
|
359
|
-
}
|
360
|
-
}, this.accessControlContext);
|
361
|
-
urls.addAll(childUrls);
|
362
|
-
} catch (PrivilegedActionException ignored) {
|
363
|
-
}
|
364
|
-
|
365
|
-
return urls.elements();
|
366
|
-
}
|
367
|
-
}
|
368
|
-
|
369
|
-
@Override
|
370
|
-
public URL getResource(String name)
|
371
|
-
{
|
372
|
-
boolean childFirst = isParentFirstPath(name);
|
373
|
-
|
374
|
-
if (childFirst) {
|
375
|
-
URL childUrl = findResource(name);
|
376
|
-
if (childUrl != null) {
|
377
|
-
return childUrl;
|
378
|
-
}
|
379
|
-
}
|
380
|
-
|
381
|
-
URL parentUrl = getParent().getResource(name);
|
382
|
-
if (parentUrl != null) {
|
383
|
-
return parentUrl;
|
384
|
-
}
|
385
|
-
|
386
|
-
if (!childFirst) {
|
387
|
-
URL childUrl = findResource(name);
|
388
|
-
if (childUrl != null) {
|
389
|
-
return childUrl;
|
390
|
-
}
|
391
|
-
}
|
392
|
-
|
393
|
-
return null;
|
394
|
-
}
|
395
|
-
|
396
|
-
@Override
|
397
|
-
public InputStream getResourceAsStream(final String resourceName)
|
398
|
-
{
|
399
|
-
final boolean childFirst = isParentFirstPath(resourceName);
|
400
|
-
|
401
|
-
if (childFirst) {
|
402
|
-
final InputStream childInputStream = getResourceAsStreamFromChild(resourceName);
|
403
|
-
if (childInputStream != null) {
|
404
|
-
return childInputStream;
|
405
|
-
}
|
406
|
-
}
|
407
|
-
|
408
|
-
final InputStream parentInputStream = getParent().getResourceAsStream(resourceName);
|
409
|
-
if (parentInputStream != null) {
|
410
|
-
return parentInputStream;
|
411
|
-
}
|
412
|
-
|
413
|
-
if (!childFirst) {
|
414
|
-
final InputStream childInputStream = getResourceAsStreamFromChild(resourceName);
|
415
|
-
if (childInputStream != null) {
|
416
|
-
return childInputStream;
|
417
|
-
}
|
418
|
-
}
|
419
|
-
|
420
|
-
return null;
|
421
|
-
}
|
422
|
-
|
423
|
-
@Override
|
424
|
-
public Enumeration<URL> getResources(String name)
|
425
|
-
throws IOException
|
426
|
-
{
|
427
|
-
List<Iterator<URL>> resources = new ArrayList<>();
|
428
|
-
|
429
|
-
boolean parentFirst = isParentFirstPath(name);
|
430
|
-
|
431
|
-
if (!parentFirst) {
|
432
|
-
Iterator<URL> childResources = Iterators.forEnumeration(findResources(name));
|
433
|
-
resources.add(childResources);
|
434
|
-
}
|
435
|
-
|
436
|
-
Iterator<URL> parentResources = Iterators.forEnumeration(getParent().getResources(name));
|
437
|
-
resources.add(parentResources);
|
438
|
-
|
439
|
-
if (parentFirst) {
|
440
|
-
Iterator<URL> childResources = Iterators.forEnumeration(findResources(name));
|
441
|
-
resources.add(childResources);
|
442
|
-
}
|
443
|
-
|
444
|
-
return Iterators.asEnumeration(Iterators.concat(resources.iterator()));
|
445
|
-
}
|
446
|
-
|
447
|
-
/**
|
448
|
-
* URLStreamHandler to handle resources in embedded JARs in the plugin JAR.
|
449
|
-
*/
|
450
|
-
private static class PluginClassURLStreamHandler
|
451
|
-
extends URLStreamHandler
|
452
|
-
{
|
453
|
-
public PluginClassURLStreamHandler(final String protocol)
|
454
|
-
{
|
455
|
-
this.protocol = protocol;
|
456
|
-
}
|
457
|
-
|
458
|
-
@Override
|
459
|
-
protected URLConnection openConnection(final URL url)
|
460
|
-
throws IOException
|
461
|
-
{
|
462
|
-
// Note that declaring variables here may cause unexpected behaviors.
|
463
|
-
// https://stackoverflow.com/questions/9952815/s3-java-client-fails-a-lot-with-premature-end-of-content-length-delimited-messa
|
464
|
-
return new URLConnection(url) {
|
465
|
-
@Override
|
466
|
-
public void connect()
|
467
|
-
{
|
468
|
-
}
|
469
|
-
|
470
|
-
@Override
|
471
|
-
public InputStream getInputStream()
|
472
|
-
throws IOException
|
473
|
-
{
|
474
|
-
final URL embulkPluginJarUrl = getURL();
|
475
|
-
if (!embulkPluginJarUrl.getProtocol().equals(protocol)) {
|
476
|
-
return null;
|
477
|
-
}
|
478
|
-
final String[] embulkPluginJarUrlSeparate = embulkPluginJarUrl.getPath().split("!!/");
|
479
|
-
if (embulkPluginJarUrlSeparate.length != 2) {
|
480
|
-
return null;
|
481
|
-
}
|
482
|
-
final URL embeddedJarUrl = new URL(embulkPluginJarUrlSeparate[0]);
|
483
|
-
final String embeddedResourceName = embulkPluginJarUrlSeparate[1];
|
484
|
-
|
485
|
-
final JarURLConnection embeddedJarURLConnection;
|
486
|
-
try {
|
487
|
-
final URLConnection urlConnection = embeddedJarUrl.openConnection();
|
488
|
-
embeddedJarURLConnection = (JarURLConnection) urlConnection;
|
489
|
-
}
|
490
|
-
catch (ClassCastException ex) {
|
491
|
-
return null;
|
492
|
-
}
|
493
|
-
|
494
|
-
final JarInputStream embeddedJarInputStream =
|
495
|
-
new JarInputStream(embeddedJarURLConnection.getInputStream());
|
496
|
-
|
497
|
-
// Note that |JarInputStream.getNextJarEntry| may throw IOException.
|
498
|
-
JarEntry jarEntry = embeddedJarInputStream.getNextJarEntry();
|
499
|
-
while (jarEntry != null) {
|
500
|
-
if (jarEntry.getName().equals(embeddedResourceName)) {
|
501
|
-
return embeddedJarInputStream; // The InputStream points the specific "JAR entry".
|
502
|
-
}
|
503
|
-
// Note that |JarInputStream.getNextJarEntry| may throw IOException.
|
504
|
-
jarEntry = embeddedJarInputStream.getNextJarEntry();
|
505
|
-
}
|
506
|
-
return null;
|
507
|
-
}
|
508
|
-
};
|
509
|
-
}
|
510
|
-
|
511
|
-
public final String protocol;
|
512
|
-
}
|
513
|
-
|
514
|
-
private static URL[] combineUrlsToArray(final URL oneNestedJarFileUrl, final Collection<URL> flatJarUrls)
|
515
|
-
{
|
516
|
-
final int offset;
|
517
|
-
final URL[] allDirectJarUrls;
|
518
|
-
if (oneNestedJarFileUrl == null) {
|
519
|
-
offset = 0;
|
520
|
-
allDirectJarUrls = new URL[flatJarUrls.size()];
|
521
|
-
}
|
522
|
-
else {
|
523
|
-
offset = 1;
|
524
|
-
allDirectJarUrls = new URL[flatJarUrls.size() + 1];
|
525
|
-
allDirectJarUrls[0] = oneNestedJarFileUrl;
|
526
|
-
}
|
527
|
-
int i = 0;
|
528
|
-
for (final URL flatJarUrl : flatJarUrls) {
|
529
|
-
allDirectJarUrls[i + offset] = flatJarUrl;
|
530
|
-
++i;
|
531
|
-
}
|
532
|
-
return allDirectJarUrls;
|
533
|
-
}
|
534
|
-
|
535
|
-
/**
|
536
|
-
* Defines a class with given class name from JARs embedded in the plugin JAR.
|
537
|
-
*
|
538
|
-
* It tries to continue even if Exceptions are throws in one of embedded JARs so that
|
539
|
-
* it can find the target class without affected from other unrelated JARs.
|
540
|
-
*/
|
541
|
-
private Class<?> defineClassFromEmbeddedJars(final String className)
|
542
|
-
throws ClassNotFoundException
|
543
|
-
{
|
544
|
-
final String classResourceName = className.replace('.', '/').concat(".class");
|
545
|
-
|
546
|
-
Throwable lastException = null;
|
547
|
-
// TODO: Speed up class loading by caching?
|
548
|
-
for (final String embeddedJarPath : this.embeddedJarPathsInNestedJar) {
|
549
|
-
final URL embeddedJarUrl;
|
550
|
-
final JarURLConnection embeddedJarUrlConnection;
|
551
|
-
final JarInputStream embeddedJarInputStream;
|
552
|
-
try {
|
553
|
-
embeddedJarUrl = getEmbeddedJarUrl(embeddedJarPath);
|
554
|
-
embeddedJarUrlConnection = getEmbeddedJarURLConnection(embeddedJarUrl);
|
555
|
-
embeddedJarInputStream = getEmbeddedJarInputStream(embeddedJarUrlConnection);
|
556
|
-
}
|
557
|
-
catch (IOException ex) {
|
558
|
-
lastException = ex;
|
559
|
-
continue;
|
560
|
-
}
|
561
|
-
|
562
|
-
final Manifest manifest;
|
563
|
-
try {
|
564
|
-
manifest = embeddedJarUrlConnection.getManifest();
|
565
|
-
}
|
566
|
-
catch (IOException ex) {
|
567
|
-
// TODO: Notify this to reporters as far as possible.
|
568
|
-
lastException = ex;
|
569
|
-
System.err.println("Failed to load manifest in embedded JAR: " + embeddedJarPath);
|
570
|
-
ex.printStackTrace();
|
571
|
-
continue;
|
572
|
-
}
|
573
|
-
|
574
|
-
JarEntry jarEntry;
|
575
|
-
try {
|
576
|
-
jarEntry = embeddedJarInputStream.getNextJarEntry();
|
577
|
-
}
|
578
|
-
catch (IOException ex) {
|
579
|
-
// TODO: Notify this to reporters as far as possible.
|
580
|
-
lastException = ex;
|
581
|
-
System.err.println("Failed to load entry in embedded JAR: " + embeddedJarPath);
|
582
|
-
ex.printStackTrace();
|
583
|
-
continue;
|
584
|
-
}
|
585
|
-
jarEntries: while (jarEntry != null) {
|
586
|
-
if (jarEntry.getName().equals(classResourceName)) {
|
587
|
-
final int lastDotIndexInClassName = className.lastIndexOf('.');
|
588
|
-
final String packageName;
|
589
|
-
if (lastDotIndexInClassName != -1) {
|
590
|
-
packageName = className.substring(0, lastDotIndexInClassName);
|
591
|
-
}
|
592
|
-
else {
|
593
|
-
packageName = null;
|
594
|
-
}
|
595
|
-
|
596
|
-
final URL codeSourceUrl = embeddedJarUrl;
|
597
|
-
|
598
|
-
// Define the package if the package is not loaded / defined yet.
|
599
|
-
if (packageName != null) {
|
600
|
-
// TODO: Consider package sealing.
|
601
|
-
// https://docs.oracle.com/javase/tutorial/deployment/jar/sealman.html
|
602
|
-
if (this.getPackage(packageName) == null) {
|
603
|
-
try {
|
604
|
-
final Attributes fileAttributes;
|
605
|
-
final Attributes mainAttributes;
|
606
|
-
if (manifest != null) {
|
607
|
-
fileAttributes = manifest.getAttributes(classResourceName);
|
608
|
-
mainAttributes = manifest.getMainAttributes();
|
609
|
-
}
|
610
|
-
else {
|
611
|
-
fileAttributes = null;
|
612
|
-
mainAttributes = null;
|
613
|
-
}
|
614
|
-
|
615
|
-
this.definePackage(
|
616
|
-
packageName,
|
617
|
-
getAttributeFromAttributes(mainAttributes, fileAttributes, classResourceName,
|
618
|
-
Attributes.Name.SPECIFICATION_TITLE),
|
619
|
-
getAttributeFromAttributes(mainAttributes, fileAttributes, classResourceName,
|
620
|
-
Attributes.Name.SPECIFICATION_VERSION),
|
621
|
-
getAttributeFromAttributes(mainAttributes, fileAttributes, classResourceName,
|
622
|
-
Attributes.Name.SPECIFICATION_VENDOR),
|
623
|
-
getAttributeFromAttributes(mainAttributes, fileAttributes, classResourceName,
|
624
|
-
Attributes.Name.IMPLEMENTATION_TITLE),
|
625
|
-
getAttributeFromAttributes(mainAttributes, fileAttributes, classResourceName,
|
626
|
-
Attributes.Name.IMPLEMENTATION_VERSION),
|
627
|
-
getAttributeFromAttributes(mainAttributes, fileAttributes, classResourceName,
|
628
|
-
Attributes.Name.IMPLEMENTATION_VENDOR),
|
629
|
-
null);
|
630
|
-
}
|
631
|
-
catch (IllegalArgumentException ex) {
|
632
|
-
// The package duplicates -- in parallel cases
|
633
|
-
if (getPackage(packageName) == null) {
|
634
|
-
// TODO: Notify this to reporters as far as possible.
|
635
|
-
lastException = ex;
|
636
|
-
System.err.println("FATAL: Should not happen. Package duplicated: " + packageName);
|
637
|
-
ex.printStackTrace();
|
638
|
-
continue;
|
639
|
-
}
|
640
|
-
}
|
641
|
-
}
|
642
|
-
}
|
643
|
-
|
644
|
-
final long classResourceSize = jarEntry.getSize();
|
645
|
-
final byte[] classResourceBytes;
|
646
|
-
final long actualSize;
|
647
|
-
|
648
|
-
if (classResourceSize > -1) { // JAR entry size available
|
649
|
-
classResourceBytes = new byte[(int) classResourceSize];
|
650
|
-
try {
|
651
|
-
actualSize = embeddedJarInputStream.read(classResourceBytes, 0, (int) classResourceSize);
|
652
|
-
}
|
653
|
-
catch (IOException ex) {
|
654
|
-
// TODO: Notify this to reporters as far as possible.
|
655
|
-
lastException = ex;
|
656
|
-
System.err.println("Failed to load entry in embedded JAR: " + classResourceName);
|
657
|
-
ex.printStackTrace();
|
658
|
-
break jarEntries; // Breaking from loading since this JAR looks broken.
|
659
|
-
}
|
660
|
-
if (actualSize != classResourceSize) {
|
661
|
-
// TODO: Notify this to reporters as far as possible.
|
662
|
-
System.err.println("Broken entry in embedded JAR: " + classResourceName);
|
663
|
-
break jarEntries; // Breaking from loading since this JAR looks broken.
|
664
|
-
}
|
665
|
-
}
|
666
|
-
else { // JAR entry size unavailable
|
667
|
-
final ByteArrayOutputStream bytesStream = new ByteArrayOutputStream();
|
668
|
-
final byte[] buffer = new byte[1024];
|
669
|
-
long accumulatedSize = 0;
|
670
|
-
while (true) {
|
671
|
-
final long readSize;
|
672
|
-
try {
|
673
|
-
readSize = embeddedJarInputStream.read(buffer, 0, 1024);
|
674
|
-
}
|
675
|
-
catch (IOException ex) {
|
676
|
-
// TODO: Notify this to reporters as far as possible.
|
677
|
-
lastException = ex;
|
678
|
-
System.err.println("Failed to load entry in embedded JAR: " + classResourceName);
|
679
|
-
ex.printStackTrace();
|
680
|
-
break jarEntries; // Breaking from loading since this JAR looks broken.
|
681
|
-
}
|
682
|
-
|
683
|
-
if (readSize < 0) {
|
684
|
-
break;
|
685
|
-
}
|
686
|
-
|
687
|
-
bytesStream.write(buffer, 0, (int) readSize);
|
688
|
-
accumulatedSize += readSize;
|
689
|
-
}
|
690
|
-
actualSize = accumulatedSize;
|
691
|
-
classResourceBytes = bytesStream.toByteArray();
|
692
|
-
}
|
693
|
-
|
694
|
-
final CodeSource codeSource = new CodeSource(codeSourceUrl, (CodeSigner[]) null);
|
695
|
-
final Class<?> definedClass;
|
696
|
-
try {
|
697
|
-
definedClass = defineClass(className, classResourceBytes, 0, (int) actualSize, codeSource);
|
698
|
-
}
|
699
|
-
catch (Throwable ex) {
|
700
|
-
// TODO: Notify this to reporters as far as possible.
|
701
|
-
lastException = ex;
|
702
|
-
System.err.println("Failed to load entry in embedded JAR: " + classResourceName);
|
703
|
-
ex.printStackTrace();
|
704
|
-
continue;
|
705
|
-
}
|
706
|
-
return definedClass;
|
707
|
-
}
|
708
|
-
try {
|
709
|
-
jarEntry = embeddedJarInputStream.getNextJarEntry();
|
710
|
-
}
|
711
|
-
catch (IOException ex) {
|
712
|
-
// TODO: Notify this to reporters as far as possible.
|
713
|
-
lastException = ex;
|
714
|
-
System.err.println("Failed to load entry in embedded JAR: " + classResourceName);
|
715
|
-
ex.printStackTrace();
|
716
|
-
break jarEntries; // Breaking from loading since this JAR looks broken.
|
717
|
-
}
|
718
|
-
}
|
719
|
-
}
|
720
|
-
if (lastException != null) {
|
721
|
-
throw new ClassNotFoundException(className, lastException);
|
722
|
-
}
|
723
|
-
else {
|
724
|
-
throw new ClassNotFoundException(className);
|
725
|
-
}
|
726
|
-
}
|
727
|
-
|
728
|
-
private InputStream getResourceAsStreamFromChild(final String resourceName)
|
729
|
-
{
|
730
|
-
if (this.oneNestedJarUrlBase == null || this.embeddedJarPathsInNestedJar.isEmpty()) {
|
731
|
-
// Multiple flat JARs -- Gem-based plugins, or Single JAR (JAR-based plugins) without any embedded JAR
|
732
|
-
return super.getResourceAsStream(resourceName);
|
733
|
-
}
|
734
|
-
else {
|
735
|
-
// Single nested JAR -- JAR-based plugins
|
736
|
-
// Resources directly in the plugin JAR are prioritized.
|
737
|
-
final InputStream inputStream = super.getResourceAsStream(resourceName);
|
738
|
-
if (inputStream == null) {
|
739
|
-
try {
|
740
|
-
final InputStream childInputStream = AccessController.doPrivileged(
|
741
|
-
new PrivilegedExceptionAction<InputStream>() {
|
742
|
-
public InputStream run()
|
743
|
-
{
|
744
|
-
return getResourceAsStreamFromEmbeddedJars(resourceName);
|
745
|
-
}
|
746
|
-
}, this.accessControlContext);
|
747
|
-
if (childInputStream != null) {
|
748
|
-
return childInputStream;
|
749
|
-
}
|
750
|
-
} catch (PrivilegedActionException ignored) {
|
751
|
-
}
|
752
|
-
}
|
753
|
-
}
|
754
|
-
return null;
|
755
|
-
}
|
756
|
-
|
757
|
-
private InputStream getResourceAsStreamFromEmbeddedJars(final String resourceName)
|
758
|
-
{
|
759
|
-
for (final String embeddedJarPath : this.embeddedJarPathsInNestedJar) {
|
760
|
-
final JarInputStream embeddedJarInputStream;
|
761
|
-
try {
|
762
|
-
embeddedJarInputStream = getEmbeddedJarInputStream(embeddedJarPath);
|
763
|
-
}
|
764
|
-
catch (IOException ex) {
|
765
|
-
// TODO: Notify this to reporters as far as possible.
|
766
|
-
System.err.println("Failed to load entry in embedded JAR: " + resourceName + " / " + embeddedJarPath);
|
767
|
-
ex.printStackTrace();
|
768
|
-
continue;
|
769
|
-
}
|
770
|
-
|
771
|
-
JarEntry jarEntry;
|
772
|
-
try {
|
773
|
-
jarEntry = embeddedJarInputStream.getNextJarEntry();
|
774
|
-
}
|
775
|
-
catch (IOException ex) {
|
776
|
-
// TODO: Notify this to reporters as far as possible.
|
777
|
-
System.err.println("Failed to load entry in embedded JAR: " + resourceName + " / " + embeddedJarPath);
|
778
|
-
ex.printStackTrace();
|
779
|
-
continue;
|
780
|
-
}
|
781
|
-
while (jarEntry != null) {
|
782
|
-
if (jarEntry.getName().equals(resourceName)) {
|
783
|
-
return embeddedJarInputStream; // Pointing the specific "JAR entry"
|
784
|
-
}
|
785
|
-
}
|
786
|
-
}
|
787
|
-
return null;
|
788
|
-
}
|
789
|
-
|
790
|
-
private URL findResourceFromEmbeddedJars(final String resourceName)
|
791
|
-
{
|
792
|
-
for (final String embeddedJarPath : this.embeddedJarPathsInNestedJar) {
|
793
|
-
final URL embeddedJarUrl;
|
794
|
-
final JarURLConnection embeddedJarUrlConnection;
|
795
|
-
final JarInputStream embeddedJarInputStream;
|
796
|
-
try {
|
797
|
-
embeddedJarUrl = getEmbeddedJarUrl(embeddedJarPath);
|
798
|
-
embeddedJarUrlConnection = getEmbeddedJarURLConnection(embeddedJarUrl);
|
799
|
-
embeddedJarInputStream = getEmbeddedJarInputStream(embeddedJarUrlConnection);
|
800
|
-
}
|
801
|
-
catch (IOException ex) {
|
802
|
-
// TODO: Notify this to reporters as far as possible.
|
803
|
-
System.err.println("Failed to load entry in embedded JAR: " +
|
804
|
-
resourceName + " / " + embeddedJarPath);
|
805
|
-
ex.printStackTrace();
|
806
|
-
continue;
|
807
|
-
}
|
808
|
-
|
809
|
-
JarEntry jarEntry;
|
810
|
-
try {
|
811
|
-
jarEntry = embeddedJarInputStream.getNextJarEntry();
|
812
|
-
}
|
813
|
-
catch (IOException ex) {
|
814
|
-
// TODO: Notify this to reporters as far as possible.
|
815
|
-
System.err.println("Failed to load entry in embedded JAR: " +
|
816
|
-
resourceName + " / " + embeddedJarPath);
|
817
|
-
ex.printStackTrace();
|
818
|
-
continue;
|
819
|
-
}
|
820
|
-
jarEntries: while (jarEntry != null) {
|
821
|
-
if (jarEntry.getName().equals(resourceName)) {
|
822
|
-
// For resources (not classes) in nested JARs, the schema and the URL should be like:
|
823
|
-
// "embulk-plugin-jar:jar:file://.../plugin.jar!/classpath/library.jar!!/org.library/resource.txt"
|
824
|
-
//
|
825
|
-
// The "embulk-plugin-jar" URL is processed with |PluginClassURLStreamHandler|.
|
826
|
-
// See also: https://www.ibm.com/developerworks/library/j-onejar/index.html
|
827
|
-
//
|
828
|
-
// The URL lives only in the JVM execution.
|
829
|
-
try {
|
830
|
-
// The URL lives only in the JVM execution.
|
831
|
-
return new URL("embulk-plugin-jar", "", -1, embeddedJarUrl + "!!/" + resourceName,
|
832
|
-
new PluginClassURLStreamHandler("embulk-plugin-jar"));
|
833
|
-
}
|
834
|
-
catch (MalformedURLException ex) {
|
835
|
-
// TODO: Notify this to reporters as far as possible.
|
836
|
-
System.err.println("Failed to load entry in embedded JAR: " +
|
837
|
-
resourceName + " / " + embeddedJarPath);
|
838
|
-
ex.printStackTrace();
|
839
|
-
break jarEntries;
|
840
|
-
}
|
841
|
-
}
|
842
|
-
try {
|
843
|
-
jarEntry = embeddedJarInputStream.getNextJarEntry();
|
844
|
-
}
|
845
|
-
catch (IOException ex) {
|
846
|
-
// TODO: Notify this to reporters as far as possible.
|
847
|
-
System.err.println("Failed to load entry in embedded JAR: " +
|
848
|
-
resourceName + " / " + embeddedJarPath);
|
849
|
-
ex.printStackTrace();
|
850
|
-
break jarEntries;
|
851
|
-
}
|
852
|
-
}
|
853
|
-
}
|
854
|
-
return null;
|
855
|
-
}
|
856
|
-
|
857
|
-
private List<URL> findResourcesFromEmbeddedJars(final String resourceName)
|
858
|
-
throws IOException
|
859
|
-
{
|
860
|
-
final ArrayList<URL> resourceUrls = new ArrayList<URL>();
|
861
|
-
for (final String embeddedJarPath : this.embeddedJarPathsInNestedJar) {
|
862
|
-
final URL embeddedJarUrl = getEmbeddedJarUrl(embeddedJarPath);
|
863
|
-
final JarURLConnection embeddedJarUrlConnection = getEmbeddedJarURLConnection(embeddedJarUrl);
|
864
|
-
final JarInputStream embeddedJarInputStream = getEmbeddedJarInputStream(embeddedJarUrlConnection);
|
865
|
-
|
866
|
-
// Note that |JarInputStream.getNextJarEntry| may throw IOException.
|
867
|
-
JarEntry jarEntry = embeddedJarInputStream.getNextJarEntry();
|
868
|
-
while (jarEntry != null) {
|
869
|
-
if (jarEntry.getName().equals(resourceName)) {
|
870
|
-
// For resources (not classes) in nested JARs, the schema and the URL should be like:
|
871
|
-
// "embulk-plugin-jar:jar:file://.../plugin.jar!/classpath/library.jar!/org.library/resource.txt"
|
872
|
-
//
|
873
|
-
// The "embulk-plugin-jar" URL is processed with |PluginClassURLStreamHandler|.
|
874
|
-
// See also: https://www.ibm.com/developerworks/library/j-onejar/index.html
|
875
|
-
//
|
876
|
-
// The URL lives only in the JVM execution.
|
877
|
-
//
|
878
|
-
// Note that |new URL| may throw MalformedURLException (extending IOException).
|
879
|
-
resourceUrls.add(new URL("embulk-plugin-jar", "", -1, embeddedJarUrl + "!!/" + resourceName,
|
880
|
-
new PluginClassURLStreamHandler("embulk-plugin-jar")));
|
881
|
-
}
|
882
|
-
// Note that |JarInputStream.getNextJarEntry| may throw IOException.
|
883
|
-
jarEntry = embeddedJarInputStream.getNextJarEntry();
|
884
|
-
}
|
885
|
-
}
|
886
|
-
return resourceUrls;
|
887
|
-
}
|
888
|
-
|
889
|
-
private URL getEmbeddedJarUrl(final String embeddedJarPath)
|
890
|
-
throws MalformedURLException
|
891
|
-
{
|
892
|
-
final URL embeddedJarUrl;
|
893
|
-
try {
|
894
|
-
embeddedJarUrl = new URL(this.oneNestedJarUrlBase, embeddedJarPath);
|
895
|
-
}
|
896
|
-
catch (MalformedURLException ex) {
|
897
|
-
// TODO: Notify this to reporters as far as possible.
|
898
|
-
System.err.println("Failed to load entry in embedded JAR: " + embeddedJarPath);
|
899
|
-
ex.printStackTrace();
|
900
|
-
throw ex;
|
901
|
-
}
|
902
|
-
return embeddedJarUrl;
|
903
|
-
}
|
904
|
-
|
905
|
-
private JarURLConnection getEmbeddedJarURLConnection(final URL embeddedJarUrl)
|
906
|
-
throws IOException
|
907
|
-
{
|
908
|
-
final JarURLConnection embeddedJarURLConnection;
|
909
|
-
try {
|
910
|
-
final URLConnection urlConnection = embeddedJarUrl.openConnection();
|
911
|
-
embeddedJarURLConnection = (JarURLConnection) urlConnection;
|
912
|
-
}
|
913
|
-
catch (IOException ex) {
|
914
|
-
// TODO: Notify this to reporters as far as possible.
|
915
|
-
System.err.println("Failed to load entry in embedded JAR: " + embeddedJarUrl.toString());
|
916
|
-
ex.printStackTrace();
|
917
|
-
throw ex;
|
918
|
-
}
|
919
|
-
return embeddedJarURLConnection;
|
920
|
-
}
|
921
|
-
|
922
|
-
private JarInputStream getEmbeddedJarInputStream(final JarURLConnection embeddedJarURLConnection)
|
923
|
-
throws IOException
|
924
|
-
{
|
925
|
-
final JarInputStream embeddedJarInputStream;
|
926
|
-
try {
|
927
|
-
final InputStream inputStream = embeddedJarURLConnection.getInputStream();
|
928
|
-
embeddedJarInputStream = new JarInputStream(inputStream);
|
929
|
-
}
|
930
|
-
catch (IOException ex) {
|
931
|
-
// TODO: Notify this to reporters as far as possible.
|
932
|
-
System.err.println("Failed to load entry in embedded JAR: " + embeddedJarURLConnection.toString());
|
933
|
-
ex.printStackTrace();
|
934
|
-
throw ex;
|
935
|
-
}
|
936
|
-
return embeddedJarInputStream;
|
937
|
-
}
|
938
|
-
|
939
|
-
private JarInputStream getEmbeddedJarInputStream(final String embeddedJarPath)
|
940
|
-
throws IOException
|
941
|
-
{
|
942
|
-
final URL embeddedJarUrl = getEmbeddedJarUrl(embeddedJarPath);
|
943
|
-
final JarURLConnection embeddedJarUrlConnection = getEmbeddedJarURLConnection(embeddedJarUrl);
|
944
|
-
return getEmbeddedJarInputStream(embeddedJarUrlConnection);
|
945
|
-
}
|
946
|
-
|
947
|
-
private static String getAttributeFromAttributes(
|
948
|
-
final Attributes mainAttributes,
|
949
|
-
final Attributes fileAttributes,
|
950
|
-
final String classResourceName,
|
951
|
-
final Attributes.Name attributeName)
|
952
|
-
{
|
953
|
-
if (fileAttributes != null) {
|
954
|
-
final String value = fileAttributes.getValue(attributeName);
|
955
|
-
if (value != null) {
|
956
|
-
return value;
|
957
|
-
}
|
958
|
-
}
|
959
|
-
if (mainAttributes != null) {
|
960
|
-
final String value = mainAttributes.getValue(attributeName);
|
961
|
-
if (value != null) {
|
962
|
-
return value;
|
963
|
-
}
|
964
|
-
}
|
965
|
-
return null;
|
966
|
-
}
|
967
|
-
|
968
|
-
private boolean isParentFirstPackage(String name)
|
969
|
-
{
|
970
|
-
for (String pkg : parentFirstPackagePrefixes) {
|
971
|
-
if (name.startsWith(pkg)) {
|
972
|
-
return true;
|
973
|
-
}
|
974
|
-
}
|
975
|
-
return false;
|
976
|
-
}
|
977
|
-
|
978
|
-
private boolean isParentFirstPath(String name)
|
979
|
-
{
|
980
|
-
for (String path : parentFirstResourcePrefixes) {
|
981
|
-
if (name.startsWith(path)) {
|
982
|
-
return true;
|
983
|
-
}
|
984
|
-
}
|
985
|
-
return false;
|
986
|
-
}
|
987
|
-
|
988
|
-
private final URL oneNestedJarUrlBase;
|
989
|
-
private final Collection<String> embeddedJarPathsInNestedJar;
|
990
|
-
private final List<String> parentFirstPackagePrefixes;
|
991
|
-
private final List<String> parentFirstResourcePrefixes;
|
992
|
-
private final AccessControlContext accessControlContext;
|
993
|
-
}
|