KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > core > connection > IResponse


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.update.internal.core.connection;
12
13 import java.io.IOException JavaDoc;
14 import java.io.InputStream JavaDoc;
15
16 import org.eclipse.core.runtime.CoreException;
17 import org.eclipse.core.runtime.IProgressMonitor;
18
19 public interface IResponse {
20
21     /**
22      * Method getInputStream.
23      *
24      * @return InputStream
25      */

26     public InputStream JavaDoc getInputStream() throws IOException JavaDoc;
27
28     /**
29      * A special version of 'getInputStream' that can be canceled.
30      * A monitor thread checks the state of the monitor
31      * and disconnects the connection if 'isCanceled()' is detected.
32      *
33      * @param monitor
34      * the progress monitor
35      * @return InputStream an opened stream or null if failed.
36      * @throws IOException
37      * if there are problems
38      * @throws CoreException
39      * if no more connection threads are available
40      */

41     public InputStream JavaDoc getInputStream(IProgressMonitor monitor)
42         throws IOException JavaDoc, CoreException, TooManyOpenConnectionsException;
43
44     /**
45      * Method getContentLength.
46      *
47      * @return long
48      */

49     public long getContentLength();
50
51     /**
52      * Method getStatusCode.
53      *
54      * @return int
55      */

56     public int getStatusCode();
57
58     /**
59      * Method getStatusMessage.
60      *
61      * @return String
62      */

63     public String JavaDoc getStatusMessage();
64
65     /**
66      * Returns the timestamp of last modification to the resource
67      *
68      * @return
69      */

70     public long getLastModified();
71     
72     /**
73      * Close the connection if open.
74      */

75     public void close();
76 }
77
Popular Tags