Monday, 15 July 2013

logging - Reading File Direction/Path Java -



logging - Reading File Direction/Path Java -

i want read path of file. i've found class file, how read file or how save file in direction.

but want method shows me path this:

c:/users/administrator/documents/netbeansprojects/hashmapdemo/headertemplate

so can save direction in xml file.

i hope understandable mean, tend write things nobody can understand.

i've tried:

public static string getcleanpath() { classloader classloader = xmlloader.class.getclassloader(); file classpathroot = new file(classloader.getresource("").getpath()); homecoming classpathroot.getpath(); }

so far said, doesn't give me info need.

maybe getabsoulepath() method looking for?

public string getabsolutepath()

returns absolute pathname string of abstract pathname.

if abstract pathname absolute, pathname string returned if getpath() method. if abstract pathname empty abstract pathname pathname string of current user directory, named scheme property user.dir, returned. otherwise pathname resolved in system-dependent way. on unix systems, relative pathname made absolute resolving against current user directory. on microsoft windows systems, relative pathname made absolute resolving against current directory of drive named pathname, if any; if not, resolved against current user directory.

returns: absolute pathname string denoting same file or directory abstract pathname

java logging

No comments:

Post a Comment