If I get your problem right, you could do something like this:
File a = new File("/some/abs/path");
File parentFolder = new File(a.getParent());
File b = new File(parentFolder, "../some/relative/path");
String absolute = b.getCanonicalPath(); // may throw IOException
Related Contents:
- How to get the path of a running JAR file?
- How to combine paths in Java?
- How to construct a relative path in Java from two absolute paths (or URLs)?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Create whole path automatically when writing to a new file
- Get java.nio.file.Path object from java.io.File
- Java: Path vs File
- How to get a path to a resource in a Java JAR file
- Check if a path represents a file or a folder
- Does Java have a path joining method? [duplicate]
- Ant path style patterns
- How to update PATH variable permanently from Windows command line?
- How to get current working directory in Java?
- How to add native library to “java.library.path” with Eclipse launch (instead of overriding it)
- How to check the extension of a Java 7 Path
- How to locate the Path of the current project directory in Java (IDE)?
- How to access a sub-file/folder in Java 7 java.nio.file.Path?
- When to use ** (double star) in glob syntax within JAVA
- InputStream from relative path
- Convert URL to normal windows filename Java
- Setting up enviroment variables in Windows 10 to use java and javac
- What does the question mark in Java generics’ type parameter mean? [duplicate]
- Android Studio error: “Manifest merger failed: Apps targeting Android 12” [duplicate]
- How to install a specific JDK on Mac OS X?
- Convert InputStream to BufferedReader
- Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
- What does the “assert” keyword do? [duplicate]
- How can I check if a method is static using reflection?
- Check if a String contains a special character
- Eclipse internal error “Polling news feeds”
- How do I compare if a string is not equal to?
- Difference between junit-jupiter-api and junit-jupiter-engine
- How can I create 2 separate log files with one log4j config file?
- time since JVM started
- android hide toolbar in specific fragment
- How to enable Logger.debug() in Log4j
- Detach an entity from JPA/EJB3 persistence context
- Web Services vs EJB vs RMI, advantages and disadvantages?
- How to change Runnable to lambda expression in Java with IntelliJ shortcut
- What is the difference between != and =! in Java? [duplicate]
- How do you determine 32 or 64 bit architecture of Windows using Java?
- How to create a file — including folders — for a given path?
- Round a double in Java
- Cannot recover key [duplicate]
- IntelliJ freezes for about 30 seconds before debugging
- How are Java threads heavy compared to Scala / Akka actors?
- static initialization in interface
- How to bind concrete classes?
- Spring ApplicationListener is not receiving events
- How to determine empty row?