Class ConcreteGate

java.lang.Object
overit.geocall.servlet.gate.Gate
overit.geocall.servlet.gate.ConcreteGate
All Implemented Interfaces:
Serializable

public class ConcreteGate extends Gate
This class extends Gate and its used to perform a file download from a Source. Here an example on how to use it:

  String sourceName = "data.txt";
  MyPersonalizedSource source = new MyPersonalizedSource());
  ConcreteGate gate = new ConcreteGate(source, sourceName, new BrowserPolicy(60, true));
  getWindow().getGateKeeper().openWeak(sourceName, gate);
  getWM().openWindow(gate);
 
Where the source is a custom class that implements Source.
See Also:
  • Field Details

    • _name

      protected String _name
    • _source

      protected Source _source
    • _uid

      protected String _uid
    • _gateKeeperCoords

      protected Map<String,String> _gateKeeperCoords
    • _autoCache

      protected boolean _autoCache
    • _cache

      protected ByteCache _cache
  • Constructor Details

    • ConcreteGate

      public ConcreteGate(Source source, String fileName, BrowserPolicy browserPolicy)
      Parameters:
      source - The Source
      fileName - String containing the name of the file that should be downloaded. If present the managing type is "download", if is null the resource is inline (nested inside the page).
      browserPolicy - The BrowserPolicy
  • Method Details

    • getUID

      public String getUID()
      Returns the UID
      Returns:
      The UID
    • setUID

      public void setUID(String uid)
      Sets the UID
      Parameters:
      uid - The UID
    • setAutoCache

      public void setAutoCache(boolean autoCache)
      Sets if the autoChace capability should be enabled
      Parameters:
      autoCache - Boolean value indicating if the autoChace capability should be enabled
    • getAutoCache

      public boolean getAutoCache()
      Returns true if autoChace is enabled, false otherwise
      Returns:
      true if autoChace is enabled, false otherwise
    • getName

      public String getName()
      Returns the name
      Returns:
      The name
    • getSource

      public Source getSource()
      Description copied from class: Gate
      Returns the Source
      Specified by:
      getSource in class Gate
      Returns:
      The Source
    • getUrl

      public String getUrl()
      Description copied from class: Gate
      Returns the URL
      Specified by:
      getUrl in class Gate
      Returns:
      The URL
    • output

      public void output(OutputStream os, boolean compressed) throws IOException
      Description copied from class: Gate
      Write in the OutputStream
      Overrides:
      output in class Gate
      Parameters:
      os - The OutputStream
      compressed - Boolean value indicating if is compressed
      Throws:
      IOException - If an I/O error occurs