agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/ftp/FTP2.java
/**
	 * Performs a stat on an absolute remote file path
	 * @param resolvedPath
	 * @return
	 * @throws FileNotFoundException 
	 * @throws RemoteDataException 
	 */
Performs a stat on an absolute remote file path
@param resolvedPath
@return
@throws FileNotFoundException
@throws RemoteDataException
Performs a stat on an absolute remote file path @param resolvedPath @return @throws FileNotFoundException @throws RemoteDataException
private RemoteFileInfo doStat(String resolvedPath) throws FileNotFoundException, RemoteDataException {
	    List<RemoteFileInfo> listing = new ArrayList<RemoteFileInfo>();
	    try 
	    {
	        Reply reply = quote("STAT " + resolvedPath);
            String replyMessage = reply.getMessage();
            StringTokenizer replyLines =
                new StringTokenizer(
                                    replyMessage,
                                    System.getProperty("line.separator"));
            if (replyLines.hasMoreElements()) {
                replyLines.nextElement();
            } else {
                throw new RemoteDataException("Expected multiline reply");
            }
            String fileName = FilenameUtils.getName(resolvedPath);
            while (replyLines.hasMoreElements()) {
                String line = (String) replyLines.nextElement();
                if (!replyLines.hasMoreElements()) break;
                RemoteFileInfo fileItem = new RemoteFileInfo(line);
                if (StringUtils.equals(fileItem.getName(), fileName)) {
                    return fileItem;
                }
            }
            if (Reply.isPositiveCompletion(reply) && !StringUtils.equals(reply.getMessage(), "STAT" + System.getProperty("line.separator") + "213 End.")) {
                RemoteFileInfo fileItem = new RemoteFileInfo();
                if (reply.getCode() == 212) {
                    fileItem.setFileType(RemoteFileInfo.FILE_TYPE);
                    fileItem.setName(fileName);
                    fileItem.setSize(super.size(resolvedPath));
                } else {
                    fileItem.setFileType(RemoteFileInfo.DIRECTORY_TYPE);
                    fileItem.setName(fileName);
                    fileItem.setSize(4096);
                }
                return fileItem;
            } 
            else 
            {
                throw new FileNotFoundException("Unknown file/folder.");
            }
	    }
	    catch (FileNotFoundException e) {
	        throw e;
	    }
	    catch (Throwable e) {
            throw new RemoteDataException("Unable to get remote file info.", e);
        }
	}
private RemoteFileInfo doStat ( String resolvedPath ) throws FileNotFoundException , RemoteDataException { List < RemoteFileInfo > listing = new ArrayList < RemoteFileInfo > ( ) ; try { Reply reply = quote ( "STAT " + resolvedPath ) ; String replyMessage = reply . getMessage ( ) ; StringTokenizer replyLines = new StringTokenizer ( replyMessage , System . getProperty ( "line.separator" ) ) ; if ( replyLines . hasMoreElements ( ) ) { replyLines . nextElement ( ) ; } else { throw new RemoteDataException ( "Expected multiline reply" ) ; } String fileName = FilenameUtils . getName ( resolvedPath ) ; while ( replyLines . hasMoreElements ( ) ) { String line = ( String ) replyLines . nextElement ( ) ; if ( ! replyLines . hasMoreElements ( ) ) break ; RemoteFileInfo fileItem = new RemoteFileInfo ( line ) ; if ( StringUtils . equals ( fileItem . getName ( ) , fileName ) ) { return fileItem ; } } if ( Reply . isPositiveCompletion ( reply ) && ! StringUtils . equals ( reply . getMessage ( ) , "STAT" + System . getProperty ( "line.separator" ) + "213 End." ) ) { RemoteFileInfo fileItem = new RemoteFileInfo ( ) ; if ( reply . getCode ( ) == 212 ) { fileItem . setFileType ( RemoteFileInfo . FILE_TYPE ) ; fileItem . setName ( fileName ) ; fileItem . setSize ( super . size ( resolvedPath ) ) ; } else { fileItem . setFileType ( RemoteFileInfo . DIRECTORY_TYPE ) ; fileItem . setName ( fileName ) ; fileItem . setSize ( 4096 ) ; } return fileItem ; } else { throw new FileNotFoundException ( "Unknown file/folder." ) ; } } catch ( FileNotFoundException e ) { throw e ; } catch ( Throwable e ) { throw new RemoteDataException ( "Unable to get remote file info." , e ) ; } }
Performs a stat on an absolute remote file path
 @param resolvedPath
 @return
 @throws FileNotFoundException
 @throws RemoteDataException
Performs a stat on an absolute remote file path @param resolvedPath @return @throws FileNotFoundException @throws RemoteDataException
// skip last line //                if (StringUtils.startsWithAny(line, new String[]{"STAT", "213 End."})) continue; //                if (StringUtils.endsWith(line, fileName)) { //                     //                }