public class

UpdateStillImageUrlTool

extends Object
java.lang.Object
   ↳ org.mbari.vars.integration.UpdateStillImageUrlTool

Summary

Constants
String FILE_PREFIX This is the key that is used to locate file URLS in the database.
byte[] GIF_KEY
byte[] JPG_KEY
byte[] PNG_KEY
String SEARCH_KEY VARS stores images in a directory that contains this as part of it's path.
Fields
public static String HTTP_PREFIX THis is the string that gets prepended onto file urls to create web URLs
Public Methods
static URL fileUrlToHttpUrl(String fileUrl)
Converts a file URL stored in a database to the coresponding http url.
static Collection findFileUrls()
Searchs the VARS database for all file URLs
static boolean isImageOnWebServer(URL url)
Checks the web server to see if the image exists.
static void main(String[] args)

static void updateStillImageUrls()

static void updateUrl(CameraData cameraData)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String FILE_PREFIX

This is the key that is used to locate file URLS in the database.

Constant Value: "file:"

public static final byte[] GIF_KEY

public static final byte[] JPG_KEY

public static final byte[] PNG_KEY

public static final String SEARCH_KEY

VARS stores images in a directory that contains this as part of it's path. The tail end of the local URL and the remote URL are the same, but the starting portions are different. This key is used to locate the parts of the path that are the same.

Constant Value: "VARS/data"

Fields

public static String HTTP_PREFIX

THis is the string that gets prepended onto file urls to create web URLs

Public Methods

public static URL fileUrlToHttpUrl (String fileUrl)

Converts a file URL stored in a database to the coresponding http url.

Returns
  • A http URL. null if the String provided should not be converted to a URL.
Throws
MalformedURLException

public static Collection findFileUrls ()

Searchs the VARS database for all file URLs

Returns
  • A collection of CameraData objects whose stillImageUrl field is a file URL.

public static boolean isImageOnWebServer (URL url)

Checks the web server to see if the image exists. IT does this by opening a stream and reading the first 3 bytes. It checks these bytes to see if its a jpg, gif or png.

Returns
  • true if the image exists.

public static void main (String[] args)

public static void updateStillImageUrls ()

public static void updateUrl (CameraData cameraData)

Throws
MalformedURLException