[
https://issues.apache.org/jira/browse/CAMEL-13711?focusedWorklogId=270700&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-270700
]
ASF GitHub Bot logged work on CAMEL-13711:
------------------------------------------
Author: ASF GitHub Bot
Created on: 02/Jul/19 08:25
Start Date: 02/Jul/19 08:25
Worklog Time Spent: 10m
Work Description: oscerd commented on pull request #3008: [CAMEL-13711]
Files.createTempFile not equivalent to File.createTempFile
URL: https://github.com/apache/camel/pull/3008
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 270700)
Time Spent: 20m (was: 10m)
> Files.createTempFile not equivalent to File.createTempFile
> ----------------------------------------------------------
>
> Key: CAMEL-13711
> URL: https://issues.apache.org/jira/browse/CAMEL-13711
> Project: Camel
> Issue Type: Bug
> Components: camel-hdfs2
> Reporter: Thomas Diesler
> Assignee: Thomas Diesler
> Priority: Major
> Fix For: 3.0.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> It seems that Files.createTempFile is NOT equivalent to File.createTempFile.
> With this debug code
> {code}
> private File getHfdsFileToTmpFile(String hdfsPath, HdfsConfiguration
> configuration) {
> try {
> String fname = hdfsPath.substring(hdfsPath.lastIndexOf('/'));
> System.out.println("fname: " + fname);
>
> File outputDest;
> try {
> System.out.println("First trying: Files.createTempFile");
> outputDest = Files.createTempFile(fname,
> ".hdfs").toFile();
> } catch (Exception ex) {
>
> ex.printStackTrace();
> System.out.println("Now trying: File.createTempFile");
> outputDest = File.createTempFile(fname, ".hdfs");
> }
>
> System.out.println("outputDest: " + outputDest);
>
> ...
> }
> },
> {code}
> I see ...
> {code}
> {12:29:50,180 INFO [stdout] fname: /ID-MacBook-1561976987280-0-1.opened
> 12:29:50,180 INFO [stdout] First trying: Files.createTempFile
> 12:29:50,189 ERROR [stderr] java.lang.IllegalArgumentException: Invalid
> prefix or suffix
> 12:29:50,189 ERROR [stderr] at
> java.nio.file.TempFileHelper.generatePath(TempFileHelper.java:63)
> 12:29:50,190 ERROR [stderr] at
> java.nio.file.TempFileHelper.create(TempFileHelper.java:127)
> 12:29:50,190 ERROR [stderr] at
> java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:161)
> 12:29:50,190 ERROR [stderr] at
> java.nio.file.Files.createTempFile(Files.java:897)
> 12:29:50,190 ERROR [stderr] at
> org.apache.camel.component.hdfs2.HdfsFileType$1.getHfdsFileToTmpFile(HdfsFileType.java:147)
> 12:29:50,190 ERROR [stderr] at
> org.apache.camel.component.hdfs2.HdfsFileType$1.createInputStream(HdfsFileType.java:131)
> 12:29:50,191 ERROR [stderr] at
> org.apache.camel.component.hdfs2.HdfsInputStream.createInputStream(HdfsInputStream.java:50)
> 12:29:50,191 ERROR [stderr] at
> org.apache.camel.component.hdfs2.HdfsConsumer.doPoll(HdfsConsumer.java:139)
> 12:29:50,191 ERROR [stderr] at
> org.apache.camel.component.hdfs2.HdfsConsumer.poll(HdfsConsumer.java:97)
> 12:29:50,191 ERROR [stderr] at
> org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:170)
> 12:29:50,191 ERROR [stderr] at
> org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:97)
> 12:29:50,191 ERROR [stderr] at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> 12:29:50,191 ERROR [stderr] at
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> 12:29:50,192 ERROR [stderr] at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> 12:29:50,192 ERROR [stderr] at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> 12:29:50,192 ERROR [stderr] at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> 12:29:50,192 ERROR [stderr] at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> 12:29:50,192 ERROR [stderr] at java.lang.Thread.run(Thread.java:748)
> 12:29:50,192 INFO [stdout] Now trying: File.createTempFile
> 12:29:50,193 INFO [stdout] outputDest:
> /var/folders/11/lsh29g8s2msbx_sv1j2zzg5c0000gn/T/ID-MacBook-1561976987280-0-1.opened3105164072945824679.hdfs
> {code}
> CrossRef: https://github.com/wildfly-extras/wildfly-camel/issues/2838
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)