JavaBean find the file under the project here is \web-inf\classes\ properties file below

Source: Internet
Author: User

String baseinfo= "/com/bean/dbhelp.properties";
Filename=getclass (). getClassLoader (). GetResource ("/"). GetPath ();
Filename=filename.substring (1,filename.length ()-1);
The above is read to the Post folder under the \web-inf\classes\
Filename=urldecoder.decode (filename, "utf-8");

The above one is to transcode the spaces in the path or the format of the meeting%20 appears

Filename=filename+baseinfo;

Above is the stitching string
File File=new file (filename);
if (File.exists ())
{
SYSTEM.OUT.PRINTLN ("presence");
}
SYSTEM.OUT.PRINTLN (filename);

The next above should be understood by everyone!

Very basic, very simple, to stimulate, please if you have a good, give me comments, I also good learning

JavaBean find the file under the project here is \web-inf\classes\ properties file below

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.