default directory of domino designer project - java

I want to access directory of domino designer project by java agent to make report from database ,I want to save this report file in agent directory I try this code
File file = new File("Local/file.txt");
but it doesn't work.Can any one help me please?

Domino Designer for Eclipse creates the Local directory for each project in a location you can figure out, but it probably is NOT the place to create a report file. The Local directory is in the Notes/Data/Workspace/<servername>/<dbpath>/Local. You would be better to use a directory below the Notes/Data directory which you can find using NotesSession.getEnviromentString("Directory", true)

Related

Advanced Installer Working in appdata

I have a simple reporting java application that is using jre archive,h2database and jasper repor.
The database file location is : appdir\files\db\tbs.mv.db
The Jasper file Jrxml file location is : appdir\files\report.jrxml
Basically i want to move the DB file to %appdata% folder so that it does not require administrator access to write to the h2database file.
In Advanced Installer Files and Folder>>Application Data
I added the folder files . Database connection working fine but not the jasper jrxml file.
Anyone can instruct me in details that how i can make my application work in %appdata% with Advanced Installer?
I was forgot catch exception. The jrxml file was not found.
Problem is solved!

Storing configuration file of an application in OS independent path

I am writing an application (basically eclipse plugin), so there are few combo-box, drop-downs etc, which I am getting values for them dynamically via XML file. My doubt is which is the best way to store these files in a particular directory so that it can be read in both Windows as well as Linux.
Initially I tried to create a config path under {eclipse.home.location} like:
String finalPath = System.getProperty("eclipse.home.location") +"/myAppConfig";
and store all of my plugin's configuration there (not only configuration but few helper jars which I programatically read in my plugin). But there is a probabilty that Eclipse installation maybe in shared location and user may not have write access to it.
I also tried to store it in a program files directory using:
System.getenv("ProgramFiles");
But this fails under non-windows environments. So my question is can anyone shed a light on this so that I can store in some common directory where it is valid for both windows and linux?
Kindly let me know if my wordings are confusing. Or is it possible to store my config files under plugins directory and get the path like this /plugins/myConfigDir ?
Try using the getStateLocation() method in Plugin.
That will give you an IPath that points to a user specific workspace location.

Root URL Location of Flex BlazeDS Project

In my Flex/BlazeDS application I'm trying to read a properties file to load database connection settings. Where should I keep this file (the location) in my project so that I can read the file as in Client Server architecture.
I tried to write a new file into the server root location
new FileOutputStream("OracleSettings.properties")
but the file was never created. I refreshed my Project, explored through Windows Explorer and Searched through Search Engine but was unable to locate OracleSettings.properties file.
How to include this file into project properties so that Eclipse will also export this file into the output folder of the application???
I use Eclipse with FlashBuilder 4.6 Plugin
I created a Flex Project with Server type Java and loaded BlazeDS war file.
Thanks in Advance.
FlexContext.getServletContext().getRealPath("/") is your web application root location.

To get the root path of file in java

I am using eclipse Indigo IDE ..I am developing a jsp application (myProject) using eclipse in which i have a property file (myProject\webcontent\db.properties) for configuring database credentials.
I am trying to access this file from a class (myProject\src\samplePackage\sampleDBConnect.java). I have exported samplePackage.jar into *myProject\webContent\WEB-INF\lib*.
I have a Test.jsp page which calls a method in sampleDBConnect.java.
When i am trying to run this Test.jsp page, the current directory path shows C:\Documents and Settings\username. I have my project in some other drive(E:).
Can someone tell me how to access the properties file....
getClass().getResourceAsStream("db.properties");
This assumes your db.properties is in the same directory "samplePackage".
If you want to keep it in src directory or say resource directory then use
getClass().getClassLoader().getResourceAsStream("db.properties");
Since your java code belongs to the same web project you don't have to create a jar of the same project and place that in the WEB-INF/lib folder
move db.properties to myProject\src dir,
java code:
InputStream input = sampleDBConnect.class.getClassLoader().getResourceAsStream("db.properties");

Issues with getting realpath while working with Eclipse Indigo

I am developing a web application.
My project is stored in
F:\Pro1\OHCMS
Now i want to upload a video in
F:\Pro1\OHCMS\Webcontent\Video
folder.
When i write
filePath=getServletContext().getRealPath("/Video")+"\\";
It is returning file path as
F:\Pro1\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\OHCMS
How can i get the real path of my actual Webcontent folder ?
Your application is being run by your IDE's default application server. That is, your WebContent folder is actually copied to somewhere else (check out your build script to know where exactly is it copied). And after that, all your data is published to server.

Categories