package pl.niekoniecznie.polar.filesystem;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by ak on 07.04.15.
 */
public class PolarFile {

    private final PolarFileSystem fs = new PolarFileSystem();
    private final String path;

    public PolarFile(String path) {
        this.path = path;
    }

    public String getPath() {
        return this.path;
    }

    public boolean isDirectory() {
        return fs.isDirectory(this);
    }

    public List<String> list() throws IOException {
        return fs.list(this);
    }

    public List<PolarFile> listFiles() throws IOException {
        if (!isDirectory()) {
            return null;
        }

        List<PolarFile> result = new ArrayList<>();

        for (String child : list()) {
            result.add(new PolarFile(child));
        }

        return result;
    }
}

@@ -490,97 +490,8 @@
  %7D%0A%0A
-    public List%3CString%3E list() throws IOException %7B%0A        return fs.list(this);%0A    %7D%0A%0A
     
@@ -546,16 +546,16 @@
 ption %7B%0A
+
         
@@ -678,48 +678,35 @@
    f
-or (String child : list()) %7B%0A           
+s.list(this).forEach((x) -%3E
  res
@@ -731,26 +731,13 @@
 ile(
-child));%0A        %7D
+x)));
 %0A%0A  

Remove redundant method. Use your first lambda expression.