Design a file system. Write code for file, directory and all necessary classes.
解法1:
这下面的解法来源于这个career cup上的回答
A file system can be represented with a Tree data structure. We can have one class called file (a directory is also a file). This class can track its current directory, its parent directory and files in this directory (in case this file is a special file called directory). Then we can create a class to manage file system which is manipulating the nodes of the tree.
Java