Here you can find the source of getFilesComposingPath(File aFile)
Parameter | Description |
---|---|
aFile | the file whose path must be retrieved. |
public static List<File> getFilesComposingPath(File aFile)
//package com.java2s; import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { /**//from w w w.java2 s . c om * Get the list of all File objects that compose the path to the given File object * * @param aFile the file whose path must be retrieved. * @return a List with all the File objects that compose the path to the given File object. */ public static List<File> getFilesComposingPath(File aFile) { List<File> fileList; if (aFile == null) { fileList = new ArrayList<File>(); } else { fileList = getFilesComposingPath(aFile.getParentFile()); fileList.add(aFile); } return fileList; } }