I need some open source and cross platform framework/tool/library which provides functionalitites commonly available to native desktop applications, for example:
A user-friendly way to install the application
Finding out user's home directory
Finding out directory for persistent storage for files and configuration (can be different from home directory)
Finding out a suitable temporary directory for temporary storage of files
Starting a component in background when user logs in
Ability to open files with corresponding default programs
Does one exist?
I have used IzPack sometimes back. It's pretty good.
Related
I have a web application built on the JVM. In this application the users are able to upload files. I read the contents of the file and do "something" with it.
In addition to this, I would like to give option to the users to put in a directory path. This directory path will be read by the application and the directory will be scanned for all relevant files (.CSV). And each will be processed.
Questions
Will the web-application be able to scan the directory located on the users machine? Or the directory path need to be in a network to which the web-app has access to?
I will be using the Commons IO package to scan the directory for files and process the files, is there a better approach?
You cannot access file system of user machine from pure web application. This task can be implemented using trusted applet or java application executed via java web start or trusted flash component or other native component (browser plugin).
Applets are almost obsolete and require JVM on client side. Java web start still requires JVM. All signed components (java based, flash, native code) require user approval.
I think that better and more modern way is to use a great feature of HTML 5 that allows not navigation to specific location on disk (that was possible since HTML 1.0) but also selecting a full directory.
Take a look on the following discussion for details: Does HTML5 allow drag-drop upload of folders or a folder tree?
I have created a Java software with a graphical interface using SWING. I have packaged it in a runneable JAR file by using he "export" function of ECLIPSE and it runs fine on my computer.
However, the function of reading files of my software does not work on some other computers.
I guess that it must be a security permission problem.
So my question is: how to give the permissions to my Jar file or how the user can give the permissions so that my software is allowed to read file?
I'm looking for something as simple as possible as i'm not going to sell my software.
EDIT: My application is a desktop application (not an applet).
Thanks,
Digitally sign the Jar.
Create an XML based (JNLP) launch file for it.
Launch it from a link using Java Web Start. JWS can install desktop shortcuts & menu items for it, if requested in the launch file and supported on the target OS.
I'm looking for something as simple as possible..
Installing applications in a way that is reliable & simple for the end user, is not easy for the developer.
I write cross-platform java app and I need some place where I can store some amount of files. These files will be used by another java application that may run under another user. This mean that I cannot use:
System.getProperty("user.home");
since I may have no permissions to read/write these files. What I need is some way to get non-user-specific folder where every app can create/read/delete files (something like "C:\ProgramData" for windows).
Is there a cross-platform way to get such folder(at least for Windows and Linux), or if there is no any - what is the best way to get such folders for Windows(should work on XP-7), Linux and Android.
Any pieces of puzzle are welcomed.
I'm not aware of such such a cross-platform folder which is additionally readable by all users. But you can:
Define a specific folder for each OS, commons-lang may help you determining the platform (see SystemUtils)
Check if the folder read/writeable for the current user during application start-up.
Using a central configuration (where the data exchange folder is defined for this installation) may also be an option, but this depends on the packaging of your project.
I'm writing a Java application which requires a number of resource files (there will be about 100 files of 20-40K each). They are not edited by the user, but will require periodic updates (the application will have a function to check for changes to the resource files and download them). Ideally, the application should be cross-platform.
Allowing write access to a subdirectory of the program directory is generally frowned upon. If I was doing it as a Windows application I might put them in Application Data, but that's not going to fly cross-platform. What would be the best place to put them?
I would typically create a directory (name starting with a period ".") in user's home directory (System.getProperty("user.home") if I am not mistaken) and use that for application specific storage. Alternatively, you could take the directory name from user at the time of application installation.
Have a directory you use to keep these files in. Put that information in a properties configuration file. When you start up load the configuration file from your application install directory. From that properties file it tells you where to find your file directory. When your installer runs it can write out this configuration file for the platform you are installing on, and that can be OS specific.
Provide a configurable location, but default to a directory in the user's home directory, or in an OS-specific location.
You'll have to deal with this in a platform-specific way no matter what. You have a few options under OS X, though. For unix-like systems either a home directory, or perhaps something under /var.
That said, I don't believe a program managing its own data in its own directory is a bad thing; consider a program with an embedded database or similar. It's much more reliable to use an app home directory.
I'm trying to make a java web start application portable. It stores some stuff in the user's home directory, and also a bunch of stuff in the cache. I'm using portableapps.com's portable java, and I've got it to store the home folder stuf using -J-Duser.home="Data", but how do I change the web cache, preferrably to a folder called "cache" in the same directory.
Take a look at this page. If you are on Windows you can go to the Java Control Panel and change the cache directory that way.