()
| 1663 | } |
| 1664 | |
| 1665 | Variable[] getFileList() { |
| 1666 | String dir = getStringArg(); |
| 1667 | File f = new File(dir); |
| 1668 | if (!f.exists() || !f.isDirectory()) |
| 1669 | return new Variable[0]; |
| 1670 | String[] list = f.list(); |
| 1671 | if (list==null) |
| 1672 | return new Variable[0]; |
| 1673 | if (!IJ.isWindows()) |
| 1674 | Arrays.sort(list); |
| 1675 | File f2; |
| 1676 | int hidden = 0; |
| 1677 | for (int i=0; i<list.length; i++) { |
| 1678 | if (list[i].startsWith(".") || list[i].equals("Thumbs.db")) { |
| 1679 | list[i] = null; |
| 1680 | hidden++; |
| 1681 | } else { |
| 1682 | f2 = new File(dir, list[i]); |
| 1683 | if (f2.isDirectory()) |
| 1684 | list[i] = list[i] + "/"; |
| 1685 | } |
| 1686 | } |
| 1687 | int n = list.length-hidden; |
| 1688 | if (n<=0) |
| 1689 | return new Variable[0]; |
| 1690 | if (hidden>0) { |
| 1691 | String[] list2 = new String[n]; |
| 1692 | int j = 0; |
| 1693 | for (int i=0; i<list.length; i++) { |
| 1694 | if (list[i]!=null) |
| 1695 | list2[j++] = list[i]; |
| 1696 | } |
| 1697 | list = list2; |
| 1698 | } |
| 1699 | Variable[] array = new Variable[n]; |
| 1700 | for (int i=0; i<n; i++) |
| 1701 | array[i] = new Variable(0, 0.0, list[i]); |
| 1702 | return array; |
| 1703 | } |
| 1704 | |
| 1705 | Variable[] newArray() { |
| 1706 | if (interp.nextToken()!='(' || interp.nextNextToken()==')') { |
no test coverage detected