code: public boolean isSubDirectory(File file1, File file2) {
          try {
              return (file1.getCanonicalPath()+File.separator).startsWith(file2.getCanonicalPath()+File.separator);
          } catch (IOException e) {
              e.printStackTrace();
              return false;
          }
      }
docs: /*
  public Reader getReader(String source) {
  ByteArrayInputStream bais = new ByteArrayInputStream(source.getBytes(charSet));
  BufferedReader reader = new BufferedReader(new InputStreamReader(bais, charSet));
  return reader;
  }