edtFTPj/Free - Open-source FTP library for Java | Download


com.enterprisedt.net.ftp
Class VMSFileParser

java.lang.Object
  extended by com.enterprisedt.net.ftp.FTPFileParser
      extended by com.enterprisedt.net.ftp.VMSFileParser

public class VMSFileParser
extends FTPFileParser

Represents a remote OpenVMS file parser. Thanks to Jason Schultz for contributing significantly to this class

Version:
$Revision: 1.9 $
Author:
Bruce Blackshaw

Field Summary
static java.lang.String cvsId
          Revision control id
 
Fields inherited from class com.enterprisedt.net.ftp.FTPFileParser
ignoreDateParseErrors
 
Constructor Summary
VMSFileParser()
          Constructor
 
Method Summary
 int getBlocksize()
          Get the VMS blocksize, used for calculating file sizes
 boolean isMultiLine()
          Does this parser parse multiple lines to get one listing?
 boolean isValidFormat(java.lang.String[] listing)
          Valid format for this parser
 boolean isVersionInName()
          Get the property that controls whether or not the version number is returned as part of the filename, e.g.
 FTPFile parse(java.lang.String raw)
          Parse server supplied string OUTPUT: Directory used/allocated dd-MMM-yyyy HH:mm:ss [unknown] (PERMS) used/allocated dd-MMM-yyyy HH:mm:ss [unknown] (PERMS) ...
 void setBlocksize(int blocksize)
          Set the VMS blocksize, used for calculating file sizes.
 void setLocale(java.util.Locale locale)
          Set the locale for date parsing of listings
 void setVersionInName(boolean versionInName)
          Set the property that controls whether or not the version number is returned as part of the filename, e.g.
 java.lang.String toString()
           
 
Methods inherited from class com.enterprisedt.net.ftp.FTPFileParser
setIgnoreDateParseErrors, split, split, split, trimStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cvsId

public static java.lang.String cvsId
Revision control id

Constructor Detail

VMSFileParser

public VMSFileParser()
Constructor

Method Detail

isMultiLine

public boolean isMultiLine()
Does this parser parse multiple lines to get one listing?

Overrides:
isMultiLine in class FTPFileParser
Returns:

getBlocksize

public int getBlocksize()
Get the VMS blocksize, used for calculating file sizes

Returns:
blocksize

setBlocksize

public void setBlocksize(int blocksize)
Set the VMS blocksize, used for calculating file sizes. This might need to be changed if unexpected file sizes are being returned for VMS files.

Parameters:
blocksize - new blocksize

isVersionInName

public boolean isVersionInName()
Get the property that controls whether or not the version number is returned as part of the filename, e.g. FILENAME.TXT;2 would be returned as is if this property is true, or FILENAME.TXT if it is false.

Returns:
true if version to be returned as part of the filename

setVersionInName

public void setVersionInName(boolean versionInName)
Set the property that controls whether or not the version number is returned as part of the filename, e.g. FILENAME.TXT;2 would be returned as is if this property is true, or FILENAME.TXT if it is false.

Parameters:
versionInName - true if version to be returned as part of the filename

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isValidFormat

public boolean isValidFormat(java.lang.String[] listing)
Valid format for this parser

Overrides:
isValidFormat in class FTPFileParser
Parameters:
listing -
Returns:
true if valid

parse

public FTPFile parse(java.lang.String raw)
              throws java.text.ParseException
Parse server supplied string OUTPUT: Directory used/allocated dd-MMM-yyyy HH:mm:ss [unknown] (PERMS) used/allocated dd-MMM-yyyy HH:mm:ss [unknown] (PERMS) ... Total of <> files, <>/<> blocks

Specified by:
parse in class FTPFileParser
Parameters:
raw - raw string to parse
Throws:
java.text.ParseException

setLocale

public void setLocale(java.util.Locale locale)
Description copied from class: FTPFileParser
Set the locale for date parsing of listings

Specified by:
setLocale in class FTPFileParser
Parameters:
locale - locale to set


Copyright (c) 2001-2007 Enterprise Distributed Technologies Ltd. All Rights Reserved.