Victor,
You can use PropertyScript to add/remove users programmatically (or any
properties in the JRun property files).
PropertyScript is explained in the Advanced Configuration Guide (ACG) for
the command-line usage. I'll try to explain how to call it from within a
servlet or other type of Java application.
To use PropertyScript from within a java app, you must:
- Include the install package:
import allaire.jrun.install.*;
- Use the public method executeScript(string scriptfile, string
propertyfile) where scriptfile is the file that contains the directives you
want executed on the JRun property file. propertyfile is the JRun property
file (for example, pass.properties, users.properties, local.properties,
etc). The syntax and options are explained in the ACG.
Here's an example that I hope illustrates these points:
import allaire.jrun.install.*;
import java.io.*;
class pstest {
public static void main (String args[]) {
String result = new String();
result = pstest.footest();
System.out.println(result);
}
private static String footest() {
String sFile = "c:\\temp3\\propt.txt";
String pFile =
"c:\\Progra~1\\Allaire\\JRun\\servers\\default\\local.properties";
String result = new String();
PropertyScript ps = new PropertyScript();
try {
ps.executeScript(sFile, pFile);
result = "successful";
}
catch (IOException ioe) {
result = "unsuccessful";
}
return result;
}
}
The contents of propt.txt could be something like (this is also covered in
the PropertyScript discussion in the ACG):
file c:\Progra~1\Allaire\JRun\servers\default\local.properties
add frog heaven
The ACG is available from the JRun documentation page on the Allaire site:
http://www.allaire.com/developer/documentation/JRun.cfm
HTH,
matt
>>-----Original Message-----
>>From: Victor Marinelli [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, December 06, 2000 11:20 AM
>>To: JRun-Talk
>>Subject: adding users/passwords programmatically
>>
>>
>>Hello,
>>
>> I want to be able to add/edit users and passwords in
>>users.properties
>>programmatically. I can do this from a command line without
>>a problem. Has
>>anyone done this from within their JSP/Servlet code?
>>
>>
>>Any help is appreciated,
>>Victor
>>
>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>Your ad could be here. Monies from ads go to support these
>>lists and provide more resources for the community.
>>http://www.fusionauthority.com/ads.cfm
>>
>>Archives: http://www.mail-archive.com/[email protected]/
>>Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists