Link to home
Start Free TrialLog in
Avatar of jazzIIIlove
jazzIIIloveFlag for Sweden

asked on

File aFile = anotherfile.toPath().getParent().resolve(newname).toFile(); to Java 1.6

Hi;

I am trying to convert a Java application which is implemented in Java1.7 to 1.6
This works fine in 1.7
File aFile = anotherfile.toPath().getParent().resolve(newname).toFile()

Open in new window


but toPath() is not recognized in 1.6

Any fast solution that is compatible with 1.6?

Regards.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Why not just File.getParent/File.getParentFile?
Avatar of jazzIIIlove

ASKER

because there is one line above:
   String newname = simpleDateFormat.format(date)+ anotherFile.getName();

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:)