FULL PRODUCT VERSION :
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
EXTRA RELEVANT SYSTEM CONFIGURATION :
NTFS filesystem with shadow volumes enabled (default in Windows 7)
A DESCRIPTION OF THE PROBLEM :
A Windows shadow volume can be accessed by creating a symbolic link to the shadow copy volume. Shadow volume paths are rejected by the JDK as invalid paths.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Start a cmd with administrator privileges
> vssadmin.exe list shadows
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
Contents of shadow copy set ID: {f18a2c98-62b6-4ca9-a97d-667b38c09d9b}
Contained 1 shadow copies at creation time: 10/18/2011 22:15:03
Shadow Copy ID: {e2103332-3f19-4e12-9578-465a19e0aa3d}
Original Volume: (C:)\\?\Volume{808aacc5-e8a3-11e0-9411-806e6f6e6963} Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4
Originating Machine:****
Service Machine:****
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessibleWriters
Attributes: Persistent, Client-accessible, No auto release, Differentia
l, Auto recovered
A link to the shadow volume can be created by using:
mklink /D C:\mnt \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4
In Java:
public static void main(String[] args)
{
try
{
Files.createSymbolicLink(Paths.get("C:\\temp\\link"),
Paths.get(" \\\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy4\\"));
}
catch (IOException e)
{
e.printStackTrace();
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A link created pointing to the shadow volume
ACTUAL -
Exception in thread "main" java.nio.file.InvalidPathException: Trailing char < > at index 0: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4 at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:166)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:147)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.nio.file.InvalidPathException: Trailing char < > at index 0: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4 at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:166)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:147)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Bug
{
public static void main(String[] args)
{
try
{
Files.createSymbolicLink(Paths.get("C:\\temp\\link"),
Paths.get(" \\\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy4\\"));
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Only workaround is to invoke a shell and execute mklink
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
EXTRA RELEVANT SYSTEM CONFIGURATION :
NTFS filesystem with shadow volumes enabled (default in Windows 7)
A DESCRIPTION OF THE PROBLEM :
A Windows shadow volume can be accessed by creating a symbolic link to the shadow copy volume. Shadow volume paths are rejected by the JDK as invalid paths.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Start a cmd with administrator privileges
> vssadmin.exe list shadows
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001-2005 Microsoft Corp.
Contents of shadow copy set ID: {f18a2c98-62b6-4ca9-a97d-667b38c09d9b}
Contained 1 shadow copies at creation time: 10/18/2011 22:15:03
Shadow Copy ID: {e2103332-3f19-4e12-9578-465a19e0aa3d}
Original Volume: (C:)\\?\Volume{808aacc5-e8a3-11e0-9411-806e6f6e6963} Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4
Originating Machine:****
Service Machine:****
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessibleWriters
Attributes: Persistent, Client-accessible, No auto release, Differentia
l, Auto recovered
A link to the shadow volume can be created by using:
mklink /D C:\mnt \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4
In Java:
public static void main(String[] args)
{
try
{
Files.createSymbolicLink(Paths.get("C:\\temp\\link"),
Paths.get(" \\\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy4\\"));
}
catch (IOException e)
{
e.printStackTrace();
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A link created pointing to the shadow volume
ACTUAL -
Exception in thread "main" java.nio.file.InvalidPathException: Trailing char < > at index 0: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4 at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:166)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:147)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.nio.file.InvalidPathException: Trailing char < > at index 0: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4 at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:166)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:147)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
public class Bug
{
public static void main(String[] args)
{
try
{
Files.createSymbolicLink(Paths.get("C:\\temp\\link"),
Paths.get(" \\\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy4\\"));
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Only workaround is to invoke a shell and execute mklink