kcs/sound へのアクセス

  • タグ:
  • タグはありません
public static void main(String[] args) throws IOException {
	String fileName = "http://(サーバIP)/kcs/sound/kc(shipID)/(fileNum).mp3";
	URL url = new URL(fileName);
	HttpURLConnection conn = (HttpURLConnection) url.openConnection();
	conn.setRequestMethod("GET");
	conn.setInstanceFollowRedirects(false);
	conn.setRequestProperty("Referer","http://(サーバIP)/kcs/mainD2.swf");
	conn.connect();
	int status = conn.getResponseCode();
	// ファイルが存在している場合200が入る
	conn.disconnect();
}