Currently I have a java application, which Loads up an xml file, and presents a simple gui for a user to edit specific fields of the xml file. However, this xml will exist on a network path. The application loads and executes just fine as long as the user has already logged into the network location. However, if they have not specifically connected to the location, and are not "logged in", the application will not execute.
Is there any way I can for instance when loading the file, connect to the network path as a specific user?
Thanks for reading. Snippets of code below.
Sample Location (Ip address removed)
private static final String wg01x = "\\\\0.0.0.0\\d$\\Variable_Namedropper_XMLs\\WG01_Variable_NameDropper_XML\\VancInsertionLabelDatelineTC.xml";
Parser Constructor Snip
public Parser(String fp){
// File Path Of XMl
try{
this.setFilePath(fp);
}catch(Exception e ){
e.printStackTrace();
}
// Main DOM Object, Uses implicit FilePath
this.setDom(this.normalizeDocument());
normalizeDocument()
public Document normalizeDocument(){
File xmlFile = new File(this.filePath);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder;
try {
dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(xmlFile);
doc.getDocumentElement().normalize();
return doc;
}catch(Exception e){
e.printStackTrace();
}
Manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.1.1.1"
processorArchitecture="X86"
name="NameDropper_wg01Y.exe"
type="win32"/>
<description>NameDropper</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Edit:: Alternate approaches are also welcome. I should be able to get access/ownership of the network location (possibly)