Hi,
As far as I understood, you want to be sure that your relative upload path works is managed at the beginning of generation process? If this is true you can try the following approach
In Webratio, in "Webratio Explorer" window create the same structure that you have in webapps folder.
So, under the WR project create WebContent/WEB-INF/conf/ folder. Copy the RTXConfig.properties from the previous generated code (${webapp_loc}/WebContent/WEB-INF/conf/RTXConfig.properties). Now you can modify this file inside the project and when you will deploy you'll have the same properties/values defined in it.
Also, in order to read/write variables inside this RTXConfig.properties file, I think you can use the java to achieve this task.
To read variables inside RTXConfig.properties :
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class App{
public static void readProperties(String path) {
// path = "pathToRTX/RTXConfig.properties"
Properties prop = new Properties();
InputStream input = null;
try {
input = new FileInputStream(path);
// load RTX Config
prop.load(input);
// get the property value and print it out
System.out.println(prop.getProperty("uploadDirectory"));
System.out.println(prop.getProperty("uploadDirectoryIsAbsolute"));
} catch (IOException ex) {
ex.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
To write variables inside RTXConfig.properties you can use the following method:
public static void writeProperty(String pathOfFile, String property, String value) {
// path = "pathToRTX/RTXConfig.properties"
Properties prop = new Properties();
OutputStream output = null;
try {
output = new FileOutputStream("path);
// set the properties value
prop.setProperty(property, value);
//prop.setProperty("uploadDirectory", "/relativePath");
// save properties to project root folder
prop.store(output, null);
} catch (IOException io) {
io.printStackTrace();
} finally {
if (output != null) {
try {
output.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
Hope this will help you