Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ApplicationResource.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal;
  5. import java.io.Serializable;
  6. import com.vaadin.Application;
  7. /**
  8. * This interface must be implemented by classes wishing to provide Application
  9. * resources.
  10. * <p>
  11. * <code>ApplicationResource</code> are a set of named resources (pictures,
  12. * sounds, etc) associated with some specific application. Having named
  13. * application resources provides a convenient method for having inter-theme
  14. * common resources for an application.
  15. * </p>
  16. *
  17. * @author Vaadin Ltd.
  18. * @since 3.0
  19. */
  20. public interface ApplicationResource extends Resource, Serializable {
  21. /**
  22. * Default cache time.
  23. */
  24. public static final long DEFAULT_CACHETIME = 1000 * 60 * 60 * 24;
  25. /**
  26. * Gets resource as stream.
  27. */
  28. public DownloadStream getStream();
  29. /**
  30. * Gets the application of the resource.
  31. */
  32. public Application getApplication();
  33. /**
  34. * Gets the virtual filename for this resource.
  35. *
  36. * @return the file name associated to this resource.
  37. */
  38. public String getFilename();
  39. /**
  40. * Gets the length of cache expiration time.
  41. *
  42. * <p>
  43. * This gives the adapter the possibility cache streams sent to the client.
  44. * The caching may be made in adapter or at the client if the client
  45. * supports caching. Default is <code>DEFAULT_CACHETIME</code>.
  46. * </p>
  47. *
  48. * @return Cache time in milliseconds
  49. */
  50. public long getCacheTime();
  51. /**
  52. * Gets the size of the download buffer used for this resource.
  53. *
  54. * <p>
  55. * If the buffer size is 0, the buffer size is decided by the terminal
  56. * adapter. The default value is 0.
  57. * </p>
  58. *
  59. * @return int the size of the buffer in bytes.
  60. */
  61. public int getBufferSize();
  62. }