tiscaf.let

ResourceLet

trait ResourceLet extends HSimpleLet

Serve static resources that are present in the classpath

Linear Supertypes
HSimpleLet, HLet, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ResourceLet
  2. HSimpleLet
  3. HLet
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def dirRoot: String

    The root directory that will be mounted to the root URI.

    The root directory that will be mounted to the root URI.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def aact(talk: HTalk): Future[Unit]

    This method contains the actual (suspendable) computation.

    This method contains the actual (suspendable) computation. The given talk parameter contains the methods to access the request and session data, as well as the method to send the response to the client. This method is called asynchronously (hence the name aact)

    Definition Classes
    HSimpleLetHLet
    See also

    tiscaf.HTalk

  7. def act(tk: HTalk): Unit

    Definition Classes
    ResourceLetHSimpleLet
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def bufSize: Int

    Buffer size.

    Buffer size. By default 4096.

    Attributes
    protected
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def e404(tk: HTalk): Unit

    Answers with an 404 error message.

    Answers with an 404 error message.

    Attributes
    protected
    Definition Classes
    HLet
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def err(status: HStatus.Value, tk: HTalk): Unit

    Answers with an error response with the given code.

    Answers with an error response with the given code.

    Attributes
    protected
    Definition Classes
    HLet
  15. def err(status: HStatus.Value, msg: String, tk: HTalk): Unit

    Answers with an error response with the given code and message.

    Answers with an error response with the given code and message.

    Attributes
    protected
    Definition Classes
    HLet
  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. def getResource(path: String): InputStream

    Returns the resource associated to the given path.

    Returns the resource associated to the given path. Following Java convention: returns null if resource is not found. We must return null for directories in jars. Official API doesn't provide any way to differentiate files and directories in jars. But stream.available() rises an error for directories.

    Attributes
    protected
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. def indexes: Seq[String]

    Index files if no file if given.

    Index files if no file if given. By default, none.

    Attributes
    protected
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. def partsAcceptor(reqInfo: HReqHeaderData): Option[HPartsAcceptor]

    When this HLet accepts multipart requests, this method must return a parts acceptor that will process the different parts.

    When this HLet accepts multipart requests, this method must return a parts acceptor that will process the different parts. An example of part acceptor is:

    class ImageUpload extends HSimpleLet {
    
      class ImagePartsAcceptor(reqInfo: HReqHeaderData)
           extends HPartsAcceptor(reqInfo) {
    
        // the parts are stored in a byte array output stream
        private var input: ByteArrayOutputStream = _
    
        // accept only uploaded image files
        def open(desc: HPartDescriptor) =
          reqInfo.header("Content-Type") match {
            case Some(mime) if mime.startsWith("image/") =>
              input = new ByteArrayOutputStream
              true
            case _ => false
          }
    
        def accept(bytes: Array[Byte]) = {
          // write part into the buffer
          input.write(bytes)
          // accept more parts
          true
        }
    
        def close {
          // save the bytes containing the image
          image = Some(input.toByteArray)
          // close the output stream
          input.close
          input = null
        }
    
        def declineAll { input = null }
     }
    
    private var image: Option[Array[Byte]] = None
    
    def act(talk: HTalk) = {
      val response = image match {
        case Some(img) => "Image uploaded"
        case None => "Not uploaded Image"
      }
    
      talk.setContentLength(response.length).write(response)
    
    }
    
    }
    Definition Classes
    HLet
  26. def plainAsDefault: Boolean

    Indicates whether the default mime type is text/plain if none could be recognized by the server (from the file extension).

    Indicates whether the default mime type is text/plain if none could be recognized by the server (from the file extension). If this is false, the default mime type will be application/octet-stream. By default, false.

    Attributes
    protected
  27. def redirect(uriPath: String, tk: HTalk): Unit

    Redirects the client to the given URI.

    Redirects the client to the given URI.

    Attributes
    protected
    Definition Classes
    HLet
  28. def sessRedirect(uriPath: String, tk: HTalk): Unit

    Redirects the client to the given URI and adds the sessions ID to the URI parameters.

    Redirects the client to the given URI and adds the sessions ID to the URI parameters.

    Attributes
    protected
    Definition Classes
    HLet
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. def uriRoot: String

    The root URI.

    The root URI.

    Attributes
    protected
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from HSimpleLet

Inherited from HLet

Inherited from AnyRef

Inherited from Any

Ungrouped