Class WebLocation

java.lang.Object
se.datadosen.jalbum.WebLocation

public class WebLocation extends Object
  • Constructor Details

  • Method Details

    • assertResolved

      public URI assertResolved() throws IOException
      Throws:
      IOException
    • getUrl

      @Deprecated public URL getUrl() throws MalformedURLException
      Deprecated.
      Use getURI instead in order to support relative paths in the future
      Returns:
      Throws:
      MalformedURLException
    • getURI

      public URI getURI()
    • setURI

      public void setURI(URI uri)
    • getFileName

      public String getFileName()
    • writeToFile

      public void writeToFile(File f) throws IOException
      Throws:
      IOException
    • print

      public void print()
    • readImage

      public BufferedImage readImage(URL u) throws IOException
      Throws:
      IOException
    • readImage

      public static BufferedImage readImage(URL u, URL referrer) throws IOException
      Throws:
      IOException
    • findRepresentingImage

      public BufferedImage findRepresentingImage() throws IOException
      Locate suitable representing image given URL. The representing image is resolved using the following steps: * First look for Facebook's og:image element * Second look for "folderthumb.jpg" (Turtle skin) * Then look for 1:st thumbnail image and locate corresponding image by replacing thumbs/ by slides/ * Then look for 1:st image pointed by album.rss feed *Finally return 1:st image larger than 120x120 or null Todo: Parse title and description too. * Finally
      Returns:
      Throws:
      IOException
    • getImageUrl

      public URL getImageUrl()
      Call after successful findRepresentingImage() call
      Returns:
    • getTitle

      public String getTitle()
      Call after successful findRepresentingImage() call
      Returns:
    • isJsonAlbum

      public boolean isJsonAlbum()
      Call after successful findRepresentingImage() call
      Returns:
    • getDescription

      public String getDescription()
      Call after successful findRepresentingImage() call
      Returns: