aspose file tools*
The moose likes Java in General and the fly likes passing files as parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "passing files as parameters" Watch "passing files as parameters" New topic
Author

passing files as parameters

sayush anand
Greenhorn

Joined: May 23, 2012
Posts: 13
Hi

I have a java application to verify digital signatures . The Generate.java class takes a file (for which signature is to be generated) as command line argument and stores two files in the bin folder , one with the public keyand other with the private key .
The Verify.java class takes 3 command line arguments , the public key file , the private key file , and the file for which signature was generated.

Instead of giving these as command arguments , can i permanently them permanently in the java programs by giving their file path or somethign ?

Any suggestions .. ?
Sumit Bisht
Ranch Hand

Joined: Jul 02, 2008
Posts: 329

While you can hardcode them in your code, it might not be a good solution.
Alternatives are to look in a file/resource bundle that contains the entries for these files.
sayush anand
Greenhorn

Joined: May 23, 2012
Posts: 13
I need to show the program today in college , hence was thinking of hardcoding it in the program .Can you please tell how to do that
Stuart A. Burkett
Ranch Hand

Joined: May 30, 2012
Posts: 679
sayush anand wrote:I need to show the program today in college , hence was thinking of hardcoding it in the program .Can you please tell how to do that

You replace the references to the command line arguments with string literals.
 
jQuery in Action, 2nd edition
 
subject: passing files as parameters