How to protect my files in a jar from extraction
I want to protect my jar files (using a password )from extraction.
When a user wants to extract, password must be asked alike password protection in a zip file.
Can i do it using java itself or i need a external tool.
Thanx
i am trying to find it out
Similar Messages
-
How can I access files that I moved from an older MacBook Pro to a newer one via Firewire and Migration assistant? The files show up on the new MacBook but cannot be opened. Thanks!
Get info then check permissions then add your curent user name (it was probably different on old Mac) and give your username full read/write permissions.
-
I have purchased an new PC since my oriiginal PC crashed after 5 years of use. I want to transfer my iTunes files from my iPAD and iPOD to my new PC.
How do you transfer files (Music/books/pictures) from an iPAD or iPOD device to an new PC that has iTunes, but no data of filesThe text below is copied from this discussion.
https://discussions.apple.com/message/11527071#11527071
Authorize your new computer's iTunes first - Store>Authorize this computer.
1) Without connecting your iPad to your laptop, start iTunes. Click on Edit. Click on Preferences. Click on Devices. Check the box next to "Prevent your iPod etc. from automatically syncing." Click OK.
2) Now connect your iPad to your laptop and start iTunes.
3) When iTunes starts, right click on your iPad under Devices in the left column. Select Transfer purchases etc.
4) After it finishes transferring all your apps to your new laptop, right click on your iPad and select Backup your iPad.
5) After it finishes backing up your iPad, right click on your iPad and select Restore etc.
6) After it finishes restoring, left click on your iPad , then click on the Apps tab on top, and check the box next to Sync Apps, then click on Apply below.
If everything on your iPad looks good after the sync, go back and click on Edit / Preferences / Devices and UN-check the box next to Prevent your iPod etc. The only other thing you may want to check is if your contacts, bookmarks, etc. are syncing correctly now. If not, go to the Info tab after connecting and make sure you indicate which features you want to sync with what sources.
This discussion has much of the same information and even some more helpful tips.
https://discussions.apple.com/thread/3305461 -
How to remove preinstalled files of adobe photoshop from my mac mini so that i can install a new version of the same software.The previous version was removed using the app cleaner software.Could not continue installation of the new version because of the existance of files from the previous version.plz help
What "app cleaner software" ? I ask because installing Photoshop over a previous version has never been a problem. Perhaps your difficulty stems from another source, eg. "cleaner software" ?
If you look in your hard drive, at the root level there is a Library. In there is a folder called Application Support, and in that you will find a folder called Adobe. Files from your previous version are there.
However, I urge you to call Adobe support to make sure you are not doing anything that would mess up other Adobe applications.
http://www.adobe.com/support/connect/connecthostedsupport.html -
How to create pdf files in UNIX directory from oracle reports
I would like to know how to create pdf files in UNIX directory from oracle reports.
Thanks,Please make your question more clear . Also mention the reports version.
1) If you are runnning reports in Unix, you can give
.... destype=file desformat=pdf desname=<filename>
in command line
Please refer docs below.
2) If by your question you mean
"My reports server is running in Windows but I want to ftp my files to Unix after creating it"
then the answer is that you can use pluggable destination "ftp"
.... destype=ftp desformat=pdf desname=<ftp url>
Pluggable destinations download
http://otn.oracle.com/products/reports/pluginxchange/index.html
Thanks
Ratheesh
[ All Docs ]
http://otn.oracle.com/documentation/reports.html
[ Publishing reports to web - 10G ]
http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
[ Building reports - 10G ]
http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
[ Forms Reports Integration whitepaper 9i ]
http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf -
How to load xsl-files out of jar-files
Hi,
I have included some xsl-files into a jar-file. I can access this files with the following code-snipped if the jar-file is local on my harddisk:
ClassLoader.getSystemClassLoader().getResource("pcodeliste.xsl").openStream()
But the problem is that I use this jar-file as a part of a j2ee-application (it's a ear-file). After deploying this ear-file to my application-server (oc4j) I get a null-pointer exception if I call the xsl-file with the code above.
Can anybody help me how to change this code or how to change the j2ee-application to have access to this files??
Thank you very much
TobiasHi Rykk!
Thanks for the answer, but it does not work since the jar, containing my file is inside an ear.
Greets,
Jay -
How to read some files inside the jar
Hi,
I have an applet that runs with JWS. The user can input some information and then I need to show this information in a web page. As the application can be run offline, I cannnot use JSP�s to generate the web page. The information is saved in a xml file, so I use a xsl parser to generate the html code. The problem is that I have to include some javascript files (.js). I put these files inside the jar, but, how can I read these files, or how can I reference these files from inside the html page ?
Thanks !You can use getClass().getResource(classpath)
to get a stream version of the data from your
jar file. If you need to put it in a file, you
can write that stream to a file in a temp directory.
classpath is the classpath of your js file -
How to read a file inside the JAR file
Hi All,
I want to save some preferences in a file called "preferences". I kept the preferences file under my java package.
If i am running the code inside the NetBeans 6.9 IDE it's working file. But once i have created a JAR and try to run the application, it couldn't find the path.
Please help me that how to resolve this issue. I don't want to save this preferences file outside of my JAR (i.e) within my java package.
Here is the code,
package mypackage;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
public class ReadFile
private void writeFile()
try
OutputStream out = new FileOutputStream(getClass().getClassLoader().getResource("mypackage/preferences").getPath().replace("%20", " "));
PrintWriter writer = new PrintWriter(out);
writer.println("Hello Java!");
writer.close();
out.close();
catch (Exception ex)
System.out.println(ex.getMessage());
private void readFile()
try
FileInputStream fi = new FileInputStream(getClass().getClassLoader().getResource("mypackage/preferences").getPath().replace("%20", " "));
BufferedReader br = new BufferedReader(new InputStreamReader(fi));
System.out.println(br.readLine().trim());
br.close();
fi.close();
catch (Exception ex)
System.out.println(ex.getMessage());
public static void main(String[] args)
ReadFile read = new ReadFile();
read.writeFile();
read.readFile();
}If i run the JAR, i get the following error message,
{color:#ff0000}*file:\my jar path\jarname.jar!\mypackage\preferences (The filename, directoryname, or volume label syntax is incorrect)*{color}Thanks sabre150,
sabre150 wrote:
You cannot update a running jar file. I am sorry. I didn't know about it. Thanks to point out.
There are two ways I approach this depending on my exact requirements -
1) use the java.util.prefs.Preferences APII will try this one
>
2) if not already present I copy the preferences file from the jar to a known place. I use a directory in the user's home directory and normally make the directory name the program with a '.' prefix.
One cannot access files in a jar file using the File API. One needs to use the getResource() or getResourceAsStream() methods on Class or ClassLoader. -
How to read a file inside a jar
Hi All,
I have a jar file which consists of several XML. I need to read one of the xml.
If the XML are in a folder it is easy to read them by directly referencing them (e.g.:- "D/Test/Sample.xml";). But if these xmls are put in a jar file i am facing trouble in reading them.
Can anyone please suggest how to read such files. Also if the classes and jar are not in the same directory.
Any help in this regard will be highly appreciated.
Thanks,
Piyushnikhil_vinay wrote:
yes i have already used "Class.getResourceAsStream ()". I guess it comes useful only when the class files and jar are in the same directory.No, wrong. The JVM has little or no concept of 'directories'
and instead relies on the classpath of the application to find
resources.
Due to some problem my jar files and my codes are in different directory. So add them to the apps' claspath and it will all be sweet. The original
responders advice will work just fine if the resource is on the classpath.
(Of course, that reply was assuming the resource was in a jar file.
If not, you will probably be needing to offer the user a JFileChooser
to access the file.)
Edited by: AndrewThompson64 on Mar 11, 2008 1:22 PM -
How to run class files in a jar independently.
Hello all
I have a java file which use an API.jar file which is an API file of some other application of mine.This file form a sought of client for that application.Now i want to run this file from command line which is giving NoClassDefFoundError exception.This exception is because of the dependency over API.jar.I dont want to pack this single file into a jar and then run that jar since it only makes a simple task complicated and makes a simple class look like a big application.Can anybody tell me the solution to it?
Regards,
MansiMansiSachar wrote:
I am working on WindowsXP and the command u just sent is again giving the same exception.The exception is :
Exception in thread "main" java.lang.NoClassDefFoundError: ûcp
Caused by: java.lang.ClassNotFoundException: ûcp
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
I think the problem can also be the placement of the dependant jars.do i need to keep them in "bin" folder?I am assuming that in the error message, it says "-cp" not "ûcp" Can you confirm that you entered the command as posted? Because it looks like java.exe sees the -cp as the class to execute instead of the classpath option.
Try using -classpath instead of -cp. What version of java are you using? (java -version should give you the version).
If the jars are in the current directory, the placement of the jar files is correct. -
How to read a file outside my .jar
Hello!
I have my j2me application in a .jar file , and my application needs to read a .txt file which is outside my .jar but in the same directory.
I tried to do :
InputStream input = getClass().getResourceAsStream("/myfile.txt");
as well as
InputStream input = getClass().getResourceAsStream("myfile.txt");
but nothing is working...
Could you help me, please??? I'm getting crazy with this :(
Thanks in advance!Thanks sabre150,
sabre150 wrote:
You cannot update a running jar file. I am sorry. I didn't know about it. Thanks to point out.
There are two ways I approach this depending on my exact requirements -
1) use the java.util.prefs.Preferences APII will try this one
>
2) if not already present I copy the preferences file from the jar to a known place. I use a directory in the user's home directory and normally make the directory name the program with a '.' prefix.
One cannot access files in a jar file using the File API. One needs to use the getResource() or getResourceAsStream() methods on Class or ClassLoader. -
How to read, write file inside the JAR file?
Hi all,
I want to read the file inside the jar file, use following method:
File file = new File("filename");
It works if not in JAR file, but it doesn't work if it's in a JAR file.
I found someone had the same problem, but no reply.
http://forum.java.sun.com/thread.jsp?forum=22&thread=180618
Can you help me ? I have tried this for all night !
Thanks in advance
LeoIf you want to read a file from the JAR file that the
application is packaged in (rather than a separate
external JAR file) you do it like this ...
InputStream is =
ClassLoader.getSystemResourceAsStream("filename");Better to use
this.getClass().getClassLoader().getResourceAsStream();
From a class near to where the data is. This deals with multiple classloaders properly. -
How to protect Conversion file from changes
Dear All,
Is there any way to restrict users on change conversion files ? my requirement is, need to protect conversion file from changes.
I have tried normal Excel password protection,it is not working.
thanks in advance...
regards,
RajuHi Raju,
Why do you want to protect the conversion file?
Conversion file is used insight of transformation file only.
That's means if an user will change the transformation file to use another conversion file it doesn't matter if you protect the conversion file.
So actaully if I understood correct is that user should not be able to change the conversion and transformation file.
This can be done in two wat:
Into task profile don't give to the user access to do Organize package list.
Second into your DM package eliminate the prompt for transformation file.
I hope this will help.
Regards
Sorin Radulescu -
Dear Sir,
I have recently purcased new mac pro but facing following problems, pls assist me:
1) I have downloded few application from iStore but this are in .ipa files and i dont know how to open this files
2) Which are good software for photo editing and business planners
3) where can i get detail information for handling the mac pro.
waiting for your reply,
Ramesh Satav
9890801841
Email : [email protected]1) A .ipa file is an app for IOS (iPhone, iPad..) and will NOT run on Mac OS X. Apps for your Mac can be found for example on the Mac App Store (you can find a link to it in the Apple menu on your menu bar).
2) I like Aperture and PixelMator
3) www.apple.com -
How to make html file on server side from the data entered in text area
Hi!
I want to know how to make .html file on server side. Like if i enter the data in text area ( or like we normaly see when we write mail that editor) and we can use html tages in it and when user submit form all the data in that field will be saved on server side as an html formate. Is it possible to do so??? or any ruff idea how to design it???Erm ...
Whats the problem with that?!
Ok, here the code ...
String myparameter = request.getParameter("paramname");
String htmltemplate = "<html>\n"
+"<head><title>demo</title></head>\n";
+"<body>@parametertag@</body>\n";
+"<html>";
String htmlpage = htmltemplate.replaceAll("@parametertag@",myparameter);
File yourHTMLfile = new File("wheredoyouwannagotoday.html");
FileOutputStream fos = new FileOutputStream(yourHTMLfile);
fos.write(htmlpage.getBytes());
fos.close();You're done.
Happy Coding! :-) ©
Maybe you are looking for
-
JQuery text-field not deactivable in IE
Good morning guys! I am suffering from a problem with my old favourite Internet Explorer 8 ;-). I have some jQuery code that (de-)activates and colours some report columns based on another column value. While this code is working perfectly in all bro
-
Web photo gallery won't open on internet... why?
I hope someone can help me with this. I always made slideshows with Photoshop until I got Elements. The newest version of Photoshop does not have that option anymore. I made a web photo gallery with elements, put it up in Dreamweaver, made a link, te
-
Hello, I'm trying to create a button menu with popup but come to the following problem: I can import a button, but I want to use my own and not the premade. I have made the button with insert/new button. All ok untill there, but I want to save the bu
-
GTK Styles and Fonts duplicate
Hi there. I found a problem after installing gtk-qt-engine. In my LookNFeel menus from Control Center, the option "GTK Styles and Fonts" appears twice. I looked at the installation package and it seems fine.. with only one file in LookNFeel folder (/
-
Which module requires more coding?
Hello SDN, I am trying to assess the different modules extracted in BW in terms of which module is more code intensive such that Abap skills is more required. Bt Abap, I exclude start routines, transfer and update rules. I am more looking at enhancem