Hello.
I have a app designed to organize dir’s on on the C drive where it was created. XML is extensively used in the business logic and house cleaning etc.
public static final String USERHOMEDIR = System.getProperty("user.home", ".");
<linkPath>
C:\Users\Steves\Documents\.targetGuide\admin_\admin\Note Folder\test\c drive test tab\index
</linkPath>
public static final String USERHOMEDIR = System.getProperty("user.home", ".");
Now, this app is running from a jump drive. Its intended purpose is to run as a standalone app on a jump drive and organize dir’s on the same thumb drive.
Now, when My XML is written it is in a different pattern that looks like this :
<linkPath>
K:\\.targetGuide\admin_\admin\Note Folder\CREATED ON THUMB\index
</linkPath>
<linkPath>
C:\Users\Steves\Documents\.targetGuide\admin_\admin\Note Folder\test\c drive test tab\index
</linkPath>
public static final String USERHOMEDIR = System.getProperty("user.home", ".");
First, What is the definition or difference between C:\ and K:\ concerning the double or single backslashes?
Secondly, If I use the jump drive at another client machine it may again change the drive letter to another relative path.
<linkPath>
L:\\.targetGuide\admin_\admin\Note Folder\CREATED ON THUMB\index
</linkPath>
Now when I get to the next client machine it may write another drive letter. Obviously, Reading XML elements using previous drive letters will not be found and the app will fail.
What are my options?
Can a variable be used to generalize the drive letter when written to XML? Then when the XML is read it could be translated to equal : ?
public static final String USERHOMEDIR = System.getProperty("user.dir", ".");
<linkPath>
L:\\.targetGuide\admin_\admin\Note Folder\CREATED ON THUMB\index
</linkPath>
I am not really able to think this one through. Yet, I would ask if it was possible to force a consistent unique drive letter regardless of the client machine?