org.jmythapi.protocol.response
Interface IFileStatus

All Superinterfaces:
Cloneable, IPropertyAware<IFileStatus.Props>, IVersionable
All Known Implementing Classes:
FileStatus

public interface IFileStatus
extends IVersionable, IPropertyAware<IFileStatus.Props>

An interface to get the status of a file on a MythTV backend.

This interface represents the response to a IBackend.queryCheckFile or IBackend.queryFileExists request.
This interface is property-aware. See the properties-list for all properties of a file-status object.

A request example:


      IBackend backend = ....;     // an already connected backend
      IProgramInfo program = ....; // a previously recorded program
      
      // query if the preview image exists
      String previewImageName = program.getPreviewImageName();
      IFileStatus fileStatus = backend.queryFileExists(previewImageName,"Default");	
      if (fileStatus.fileExists()) {
         System.out.println("Preview image found: " + fileStatus.getFilePath());
      } else {
         System.out.println("Preview image not found.");
      }
 

A response example:

For a recording preview image (protocol version 56):
<0>FILE_EXISTS: true | <1>FILE_PATH: /var/lib/mythtv/recordings//1063_20110329201000.mpg.png
For a Live-TV recording (protocol version 56):
<0>FILE_EXISTS: true | <1>FILE_PATH: /var/lib/mythtv/livetv/1063_20110410104434.mpg
For a scheduled recording (protocol version 63):
<00>FILE_EXISTS: true | <01>FILE_PATH: /var/lib/mythtv/recordings//1000_20110701123000.mpg | <02>DEV: 2049 | <03>INO: 136043 | <04>MODE: 33188 | <05>NLINK: 1 | <06>UID: 109 | <07>GID: 117 | <08>RDEV: 0 | <09>FILE_SIZE: 65792000 | <10>BLKSIZE: 4096 | <11>BLOCKS: 128504 | <12>ATIME: Fri Jul 01 12:30:09 CEST 2011 | <13>MTIME: Fri Jul 01 12:31:00 CEST 2011 | <14>CTIME: Fri Jul 01 12:31:00 CEST 2011

See Also:
IBackend.queryCheckFile(org.jmythapi.protocol.response.IProgramInfo, java.lang.Boolean), IBackend.queryFileExists(org.jmythapi.protocol.response.IProgramInfo), QUERY_CHECKFILE, QUERY_FILE_EXISTS

Nested Class Summary
static class IFileStatus.Props
          The properties of an IFileStatus response.
 
Method Summary
 boolean fileExists()
          Checks if the queried file exists.
 String getFilePath()
          Gets the full path of queried file.
 Long getFileSize()
          Gets the size of the file in bytes.
 Date getLastModified()
           
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 
Methods inherited from interface org.jmythapi.IPropertyAware
getProperties, getProperty, getPropertyClass, getPropertyCount, getPropertyIndex, getPropertyMap, getPropertyValue, getPropertyValue, getPropertyValueObject, getPropertyValues, setPropertyValue, setPropertyValue, setPropertyValueObject
 

Method Detail

fileExists

boolean fileExists()
Checks if the queried file exists.

Returns:
true if the queried file exists.

getFilePath

String getFilePath()
Gets the full path of queried file.

Returns:
the files full path, or null if the file was not found.

getFileSize

Long getFileSize()
Gets the size of the file in bytes.

Returns:
the file size in bytes.

getLastModified

Date getLastModified()


Copyright © 2008-2013. All Rights Reserved.