Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to get the parents of an file

Java: How to get the parents of an file

import java.io.File;
import java.io.IOException;
public class File_P
  public static void main(String[] argv) throws IOException
    File file = new File("c:/test2test.txt");
    // Get the name of the parent
    String ch_parent = file.getParent();
    // get parent directory
    File rep_parent = file.getParentFile();

Users who found this page were searching for:

  • sql query read csv
  • perl factorial
  • how to get last week in java
  • print working directory python
  • Python Check File Extension
  • count lines perl
  • Base64
  • java program that prints a calendar
  • iterate dictionary python

No comments yet.

Leave a Comment