• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining if an image exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining if an image exists


  • Subject: Re: Determining if an image exists
  • From: Karl Moskowski <email@hidden>
  • Date: Thu, 17 Feb 2005 15:40:08 -0500

David,

I use a method like this to tell if an iCal file exists on a webdav server. It should work with any kind of file at an http url.

public boolean fileExists(String httpUrl) {
boolean fileExists = true;
// use URL to parse the host, port and path out of the passed in httpurl
URL url = new URL(httpUrl);
String host = url.getHost();
String urlPath = url.getPath();
int port = (url.getPort() == -1 ? 80 : url.getPort());
WOHTTPConnection connection = new WOHTTPConnection(host, port);
connection.setKeepAliveEnabled(false);
WORequest request = new WORequest("GET", urlPath, "HTTP/1.1", null, null, null);
if (!connection.sendRequest(request))
fileExists = false;
return fileExists;
}


Regards,
Karl.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Web page design in WO
  • Next by Date: Re: attempt to assign value to unknown key
  • Previous by thread: Re: Determining if an image exists
  • Next by thread: build failing: package com.webobjects.foundation does not exist
  • Index(es):
    • Date
    • Thread