1 package ch
.cyberduck
.core
.ftp
.parser
;
4 * Copyright (c) 2009 Ansgar Esztermann. All rights reserved.
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:
22 import org
.apache
.commons
.net
.ftp
.FTPFile
;
27 public class UnitreeFTPEntryParser
extends CommonUnixFTPEntryParser
{
29 private static final String REGEX
=
31 +"(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\+?\\s+"
34 + "(?:(\\S+(?:\\s\\S+)*)\\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+"
57 public UnitreeFTPEntryParser() {
62 public FTPFile
parseFTPEntry(String 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
);