ADDITIONAL SYSTEM INFORMATION :
OS: Microsoft Windows 10 Enterprise
Java: 1.8.0_232
A DESCRIPTION OF THE PROBLEM :
Calling java.nio.file.Files.copy(Path, Path, CopyOption...) using long filenames (more than 256 characters?) results in JVM exits.
The problem is related to windows device path, ones starting with "\\?\"
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Call java.nio.file.Files.copy(Path, Path, CopyOption...) with a long filename in "target" parameter
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
File copied to destination.
In the attached example, it is expected to print: "prepare to copy" and "copy OK" but the latter is not.
ACTUAL -
JVM exits
---------- BEGIN SOURCE ----------
public class CopyFiles
{
public static void main(String[] args) throws IOException
{
File source = new File(
"C:/Projects/dev/GIT/xdm-customer-project/web/dist/target/war/work/com.energeya.xdm2/xdm2.rap.war/WEB-INF/plugins/xdm2.commons.client.core/it/openmindonline/xdm/client/common/databinding/FromListToReferenceCodeUpdateStrategy$FromListToReferenceCodeConverter.class");
File target = new File(
"C:/Projects/dev/GIT/xdm-customer-project/web/dist/target/template.web.client.dist-20.2.0-SNAPSHOT/WEB-INF/plugins/xdm2.commons.client.core/it/openmindonline/xdm/client/common/databinding/FromListToReferenceCodeUpdateStrategy$FromListToReferenceCodeConverter.class");
if (!source.exists())
{
throw new IllegalArgumentException("source does not exists");
}
System.out.println("prepare to copy");
Files.copy(source.toPath(),
target.toPath(),
StandardCopyOption.REPLACE_EXISTING,
StandardCopyOption.COPY_ATTRIBUTES);
System.out.println("copy OK");
}
}
---------- END SOURCE ----------
FREQUENCY : always
OS: Microsoft Windows 10 Enterprise
Java: 1.8.0_232
A DESCRIPTION OF THE PROBLEM :
Calling java.nio.file.Files.copy(Path, Path, CopyOption...) using long filenames (more than 256 characters?) results in JVM exits.
The problem is related to windows device path, ones starting with "\\?\"
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Call java.nio.file.Files.copy(Path, Path, CopyOption...) with a long filename in "target" parameter
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
File copied to destination.
In the attached example, it is expected to print: "prepare to copy" and "copy OK" but the latter is not.
ACTUAL -
JVM exits
---------- BEGIN SOURCE ----------
public class CopyFiles
{
public static void main(String[] args) throws IOException
{
File source = new File(
"C:/Projects/dev/GIT/xdm-customer-project/web/dist/target/war/work/com.energeya.xdm2/xdm2.rap.war/WEB-INF/plugins/xdm2.commons.client.core/it/openmindonline/xdm/client/common/databinding/FromListToReferenceCodeUpdateStrategy$FromListToReferenceCodeConverter.class");
File target = new File(
"C:/Projects/dev/GIT/xdm-customer-project/web/dist/target/template.web.client.dist-20.2.0-SNAPSHOT/WEB-INF/plugins/xdm2.commons.client.core/it/openmindonline/xdm/client/common/databinding/FromListToReferenceCodeUpdateStrategy$FromListToReferenceCodeConverter.class");
if (!source.exists())
{
throw new IllegalArgumentException("source does not exists");
}
System.out.println("prepare to copy");
Files.copy(source.toPath(),
target.toPath(),
StandardCopyOption.REPLACE_EXISTING,
StandardCopyOption.COPY_ATTRIBUTES);
System.out.println("copy OK");
}
}
---------- END SOURCE ----------
FREQUENCY : always