org.easetech.easytest.io
Interface Resource

All Known Implementing Classes:
ClasspathResource, EmptyResource, FileSystemResource, UrlResource

public interface Resource

Interface representing a generic Resource to be used by the EasyTEst framework. Three implementations exists for this interface in the EasyTest framework:

  • ClasspathResource - Resources that exists in the Classpath
  • FileSystemResource - Resources that exists in the FileSystem
  • UrlResource - Resource that exists as a URL(http , ftp) etc

    Author:
    Anuj Kumar

    Method Summary
     boolean exists()
              Indicates whether the resource exists or not
     File getFile()
              Get the File associated with the resource
     InputStream getInputStream()
              Get the InputStream associated with the resource
     OutputStream getOutputStream()
              Get the OutputStream associated with the resource
     String getResourceName()
              Get the resource name
     URL getURL()
              get the URL associated with the resource
     

    Method Detail

    exists

    boolean exists()
    Indicates whether the resource exists or not

    Returns:
    boolean

    getInputStream

    InputStream getInputStream()
                               throws IOException
    Get the InputStream associated with the resource

    Returns:
    InputStream
    Throws:
    IOException - if an IOException occurs

    getOutputStream

    OutputStream getOutputStream()
                                 throws IOException
    Get the OutputStream associated with the resource

    Returns:
    OutputStream
    Throws:
    IOException - if an IOException occurs

    getURL

    URL getURL()
    get the URL associated with the resource

    Returns:
    URL

    getFile

    File getFile()
                 throws Exception
    Get the File associated with the resource

    Returns:
    File
    Throws:
    Exception

    getResourceName

    String getResourceName()
    Get the resource name

    Returns:
    String


    Copyright © 2013. All Rights Reserved.