1 22 23 package org.aspectj.debugger.request; 24 25 import org.aspectj.debugger.base.*; 26 import java.io.File ; 27 import java.util.*; 28 29 33 34 public class LsRequest extends Request { 35 36 String fileName; 37 public LsRequest(Debugger debugger, String fileName) { 38 super(debugger); 39 this.fileName = fileName; 40 } 41 42 public Object go() throws NoVMException, DebuggerException { 43 if (fileName == null || "".equals(fileName)) { 44 fileName = "."; 45 } 46 List list = new Vector(); 47 File pwd = new File (fileName); 48 if (pwd == null || !pwd.exists()) { 49 return list; 50 } 51 File [] files = pwd.listFiles(); 52 if (files == null) { 53 return list; 54 } 55 for (int i = 0; i < files.length; i++) { 56 list.add(files[i]); 57 } 58 return list; 59 } 60 } 61 | Popular Tags |