Sha256: 03acfd41b8865fc08e879ec7b4412105f10a880c500d61670e7a07c612a5aeb9

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

module WirisPlugin
include  Wiris
require('com/wiris/plugin/api/ServiceResourceLoader.rb')
  class ServiceResourceLoaderImpl
  extend ServiceResourceLoaderInterface

  include Wiris

    def initialize()
      super()
    end
    def getContent(resource)
      return Storage::newResourceStorage(resource)::read()
    end
    def getContentType(name)
      ext = Std::substr(name,name::lastIndexOf(".")+1)
      if (ext=="png")
        return "image/png"
      else 
        if (ext=="gif")
          return "image/gif"
        else 
          if (ext=="jpg")||(ext=="jpeg")
            return "image/jpeg"
          else 
            if (ext=="html")||(ext=="htm")
              return "text/html"
            else 
              if (ext=="css")
                return "text/css"
              else 
                if (ext=="js")
                  return "application/javascript"
                else 
                  if (ext=="txt")
                    return "text/plain"
                  else 
                    if (ext=="ini")
                      return "text/plain"
                    else 
                      return "application/octet-stream"
                    end
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wirispluginengine-3.62.0.1322 lib/com/wiris/plugin/impl/ServiceResourceLoaderImpl.rb