获取构建给定文件的规范路径的各个路径元素。
// Copyright (C) 2001-2012 Michael Bayne, et al./* from n o w j a v a . c o m - 时代Java*/ //package com.nowjava; import java.io.File; import java.io.IOException; public class Main { /** * Gets the individual path elements building up the canonical path to the given file. */ public static String[] getCanonicalPathElements(File file) throws IOException { file = file.getCanonicalFile(); // If we were a file, get its parent if (!file.isDirectory()) { file =