if (lineSeparator == null) { GetPropertyAction getProperty = new GetPropertyAction("line.separator"); lineSeparator = (String) AccessController.doPrivileged(getProperty); }  StringBuffer sb = new StringBuffer(); String[] files = file.list();  for (int index = 0; index < files.length; ++index) sb.append(files[index]).append(lineSeparator);  inputStream = new ByteArrayInputStream(sb.toString().getBytes());
inputStream = new ByteArrayInputStream(getDirectoryListing());
  public void connect() throws IOException  {    // Call is ignored if already connected.    if (connected)      return;        // If not connected, then file needs to be openned.    file = new File (getURL().getFile());    if (! file.isDirectory())      {	if (doInput)	  inputStream = new BufferedInputStream(new FileInputStream(file));    	if (doOutput)	  outputStream = new BufferedOutputStream(new FileOutputStream(file));      }    else      {	if (doInput)	  {	    if (lineSeparator == null)	      {		GetPropertyAction getProperty = new GetPropertyAction("line.separator");		lineSeparator = (String) AccessController.doPrivileged(getProperty);	      }	    	    StringBuffer sb = new StringBuffer();	    String[] files = file.list();	    for (int index = 0; index < files.length; ++index)	       sb.append(files[index]).append(lineSeparator);	    inputStream = new ByteArrayInputStream(sb.toString().getBytes());	  }	if (doOutput)	  throw new ProtocolException	    ("file: protocol does not support output on directories");      }        connected = true;  }