⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addurltocollection.java

📁 关于Ultraseek的一些用法,刚初学,所以都是比较简单
💻 JAVA
字号:
/* -*- mode:java; indent-tabs-mode:nil; c-basic-offset:2 -*- * *  $RCSFile$ $Revision: 1.18 $ $Date: 2006/02/01 00:17:24 $ * *  Copyright (c) 2000-2002 Autonomy Corp.  All Rights Reserved. * * */import java.io.BufferedReader;import java.io.InputStreamReader;import java.net.URL;import com.ultraseek.xpa.server.UltraseekServer;import com.ultraseek.xpa.server.UltraseekCollection;import com.ultraseek.xpa.server.ScannerCollection;import com.ultraseek.xpa.server.SpiderCollection;/** *  A simple demo application that adds URLs  *  to an Ultraseek collection. */public class AddURLToCollection {  AddURLToCollection() { }  public static void main(String[] args) throws Exception {    InputStreamReader inputStreamReader = new InputStreamReader(System.in);    BufferedReader bufferedReader = new BufferedReader(inputStreamReader);    System.out.println();    System.out.println("This is a simple demo application that adds URLs");    System.out.println("to an Ultraseek collection.");    System.out.println();    System.out.println("Enter the hostname and TCP port of your");    System.out.println("running Ultraseek instance.");    System.out.print("hostname: ");    String host = bufferedReader.readLine();    System.out.print("TCP port: ");    int port = Integer.parseInt(bufferedReader.readLine());    UltraseekServer server = new UltraseekServer(host,port);    System.out.println();    System.out.println("Here is the UltraseekServer object:");    System.out.println(server);    System.out.println("Enter the internal name of the collection.");    System.out.print("collection: ");    String id = bufferedReader.readLine();    UltraseekCollection collection =       (UltraseekCollection)server.getSearchCollection(id);    System.out.println();    System.out.println("Here is the UltraseekCollection object:");    System.out.println(collection);    for (;;) {      System.out.println();      System.out.println("Enter a URL to add.");      System.out.print("URL: ");      String line = bufferedReader.readLine();      if (line==null) break;      URL url = new URL(line);      if (collection instanceof SpiderCollection) {        ((SpiderCollection)collection).addURL(url);      } else if (collection instanceof ScannerCollection) {        ((ScannerCollection)collection).addURL(url);      } else {        System.out.println("Can't addURL on that kind of collection.");        continue;      }      System.out.println("Done.");    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -