Add session to cache with both hostname and address.
[cyberduck.git] / source / ch / cyberduck / core / ftp / parser / UnitreeFTPEntryParser.java
blobbf9e45e003aae275f4bee221f2d17a9bc89ac3cc
1 package ch.cyberduck.core.ftp.parser;
3 /*
4 * Copyright (c) 2009 Ansgar Esztermann. All rights reserved.
6 * http://cyberduck.ch/
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * Bug fixes, suggestions and comments should be sent to:
19 * aeszter@gwdg.de
22 import org.apache.commons.net.ftp.FTPFile;
24 /**
25 * @version $Id$
27 public class UnitreeFTPEntryParser extends CommonUnixFTPEntryParser {
29 private static final String REGEX =
30 "([bcdlfmpSs-])"
31 +"(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\+?\\s+"
32 + "(\\d+)\\s+"
33 + "(\\S+)\\s+"
34 + "(?:(\\S+(?:\\s\\S+)*)\\s+)?"
35 /**
36 * disk/tape
38 + "(DK|AR)\\s+"
39 /**
40 * unclear
42 + "(\\S+)\\s+"
43 + "(\\d+)\\s+"
45 numeric or standard format date
47 + "((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S+\\s+\\S+))\\s+"
50 year (for non-recent standard format)
51 or time (for numeric or recent standard format
53 + "(\\d+(?::\\d+)?)\\s+"
54 + "(\\S*)(\\s*.*)";
57 public UnitreeFTPEntryParser() {
58 super(REGEX);
61 @Override
62 public FTPFile parseFTPEntry(String entry) {
63 if (matches(entry))
65 String typeStr = group(1);
66 String usr = group(16);
67 String grp = group(17);
68 String filesize = group(20);
69 String datestr = group(21) + " " + group(22);
70 String name = group(23);
71 String endtoken = group(24);
72 return super.parseFTPEntry(typeStr, usr, grp, filesize, datestr, name, endtoken);
74 return null;