Skip to content

Commit

Permalink
Initial revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Smith committed Nov 13, 2001
0 parents commit 0a4cc64
Show file tree
Hide file tree
Showing 66 changed files with 28,659 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -0,0 +1,7 @@
2001-11-14 Chris Smith <chris@jacko.com> (0.3-b1)

* Renamed package and main class from GalleryUp to GalleryRemote.

2001-11-12 Chris Smith <chris@jacko.com> (0.2)

* v0.2 - The first release of Gallery Remote.
28 changes: 28 additions & 0 deletions HTTPClient/0COPYRIGHT
@@ -0,0 +1,28 @@
/*
* Copyright (c) 1996-2001 Ronald Tschal�r
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307, USA
*
* For questions, suggestions, bug-reports, enhancement-requests etc.
* I may be contacted at:
*
* ronald@innovation.ch
*
* The HTTPClient's home page is located at:
*
* http://www.innovation.ch/java/HTTPClient/
*
*/
504 changes: 504 additions & 0 deletions HTTPClient/0LICENSE

Large diffs are not rendered by default.

76 changes: 76 additions & 0 deletions HTTPClient/0README
@@ -0,0 +1,76 @@

This is Version 0.3-3 of the HTTPClient package. The latest version should
always be available at http://www.innovation.ch/java/HTTPClient/ .
Copyright (C) 1996-2001 Ronald Tschal�r

The HTTPClient is fairly full-featured http client library. It implements
most of the relevant parts of HTTP/1.1, and automatically handles things
like redirections, authorization, and cookies. The functionality can be
easily extended through the use of modules.


Installation:
-------------

Unpacking the .tar.Z or .zip should've created a subdirectory
'HTTPClient'. Put this directory somewhere in your classpath. If you
haven't done the following already I recommend setting up a main
directory that contains a subdirectory for every java package you
install, and then add this main directory to your classpath - that way
for new packages all you have to do is unpack them into a subdirectory
under that main directory and away you go. Now add a 'import
HTTPClient.*;' statement to each of your files that use any part of the
package and you're set to go.

Alternatively you can put everything into a zip file and add that file
to your CLASSPATH. If your JDK/development-environment supports
compressed zip files and you downloaded the HTTPClient.zip file then
you can just add that file to your CLASSPATH. If you downloaded the
tar file, or if your JDK does not support compressed zip files, then
unpack the HTTPClient and create an uncompressed zip file to put in
the CLASSPATH with something like the following:

zip -r0 HTTPClient.zip HTTPClient -i '*.class'


Directory Structure:
--------------------

HTTPClient -- the source and compiled class files
|
+-- http --- the http handler (for use with URLConnection)
|
+-- shttp -- the shttp handler (for use with URLConnection)
|
+-- https -- the https handler (for use with URLConnection)
|
+-- alt ---- alternative versions of the core classes
| |
| +-- HotJava ---- the HotJava specific replacement classes
|
+-- doc -- all the documentation
|
+-- api ----- all the javadoc generated api docs
|
+-- images -- images for the documentation


Use:
----

See the documentation in the doc subdirectory. The beginning is at
HTTPClient/doc/index.html .


Comments:
---------

Mail suggestions, comments, bugs, enhancement-requests to:

ronald@innovation.ch


Have fun,

Ronald

66 changes: 66 additions & 0 deletions HTTPClient/AuthSchemeNotImplException.java
@@ -0,0 +1,66 @@
/*
* @(#)AuthSchemeNotImplException.java 0.3-3 06/05/2001
*
* This file is part of the HTTPClient package
* Copyright (C) 1996-2001 Ronald Tschalär
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307, USA
*
* For questions, suggestions, bug-reports, enhancement-requests etc.
* I may be contacted at:
*
* ronald@innovation.ch
*
* The HTTPClient's home page is located at:
*
* http://www.innovation.ch/java/HTTPClient/
*
*/

package HTTPClient;


/**
* Signals that the handling of a authorization scheme is not implemented.
*
* @version 0.3-3 06/05/2001
* @author Ronald Tschalär
*/
public class AuthSchemeNotImplException extends ModuleException
{

/**
* Constructs an AuthSchemeNotImplException with no detail message.
* A detail message is a String that describes this particular exception.
*/
public AuthSchemeNotImplException()
{
super();
}


/**
* Constructs an AuthSchemeNotImplException class with the specified
* detail message. A detail message is a String that describes this
* particular exception.
*
* @param msg the String containing a detail message
*/
public AuthSchemeNotImplException(String msg)
{
super(msg);
}
}
151 changes: 151 additions & 0 deletions HTTPClient/AuthorizationHandler.java
@@ -0,0 +1,151 @@
/*
* @(#)AuthorizationHandler.java 0.3-3 06/05/2001
*
* This file is part of the HTTPClient package
* Copyright (C) 1996-2001 Ronald Tschalär
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307, USA
*
* For questions, suggestions, bug-reports, enhancement-requests etc.
* I may be contacted at:
*
* ronald@innovation.ch
*
* The HTTPClient's home page is located at:
*
* http://www.innovation.ch/java/HTTPClient/
*
*/

package HTTPClient;

import java.io.IOException;


/**
* This is the interface that an Authorization handler must implement. You
* can implement your own auth handler to add support for auth schemes other
* than the ones handled by the default handler, to use a different UI for
* soliciting usernames and passwords, or for using an altogether different
* way of getting the necessary auth info.
*
* @see AuthorizationInfo#setAuthHandler(HTTPClient.AuthorizationHandler)
* @version 0.3-3 06/05/2001
* @author Ronald Tschalär
*/
public interface AuthorizationHandler
{
/**
* This method is called whenever a 401 or 407 response is received and
* no candidate info is found in the list of known auth info. Usually
* this method will query the user for the necessary info.
*
* <P>If the returned info is not null it will be added to the list of
* known info. If the info is valid for more than one (host, port, realm,
* scheme) tuple then this method must add the corresponding auth infos
* itself.
*
* <P>This method must check <var>req.allow_ui</var> and only attempt
* user interaction if it's <var>true</var>.
*
* @param challenge the parsed challenge from the server; the host,
* port, scheme, realm and params are set to the
* values given by the server in the challenge.
* @param req the request which provoked this response.
* @param resp the full response.
* @return the authorization info to use when retrying the request,
* or null if the request is not to be retried. The necessary
* info includes the host, port, scheme and realm as given in
* the <var>challenge</var> parameter, plus either the basic
* cookie or any necessary params.
* @exception AuthSchemeNotImplException if the authorization scheme
* in the challenge cannot be handled.
* @exception IOException if an exception occurs while processing the
* challenge
*/
AuthorizationInfo getAuthorization(AuthorizationInfo challenge,
RoRequest req, RoResponse resp)
throws AuthSchemeNotImplException, IOException;


/**
* This method is called whenever auth info is chosen from the list of
* known info in the AuthorizationInfo class to be sent with a request.
* This happens when either auth info is being preemptively sent or if
* a 401 response is retrieved and a matching info is found in the list
* of known info. The intent of this method is to allow the handler to
* fix up the info being sent based on the actual request (e.g. in digest
* authentication the digest-uri, nonce and response-digest usually need
* to be recalculated).
*
* @param info the authorization info retrieved from the list of
* known info.
* @param req the request this info is targeted for.
* @param challenge the authorization challenge received from the server
* if this is in response to a 401, or null if we are
* preemptively sending the info.
* @param resp the full 401 response received, or null if we are
* preemptively sending the info.
* @return the authorization info to be sent with the request, or null
* if none is to be sent.
* @exception AuthSchemeNotImplException if the authorization scheme
* in the info cannot be handled.
* @exception IOException if an exception occurs while fixing up the
* info
*/
AuthorizationInfo fixupAuthInfo(AuthorizationInfo info, RoRequest req,
AuthorizationInfo challenge, RoResponse resp)
throws AuthSchemeNotImplException, IOException;


/**
* Sometimes even non-401 responses will contain headers pertaining to
* authorization (such as the "Authentication-Info" header). Therefore
* this method is invoked for each response received, even if it is not
* a 401 or 407 response. In case of a 401 or 407 response the methods
* <code>fixupAuthInfo()</code> and <code>getAuthorization()</code> are
* invoked <em>after</em> this method.
*
* @param resp the full Response
* @param req the Request which provoked this response
* @param prev the previous auth info sent, or null if none was sent
* @param prxy the previous proxy auth info sent, or null if none was sent
* @exception IOException if an exception occurs during the reading of
* the headers.
*/
void handleAuthHeaders(Response resp, RoRequest req,
AuthorizationInfo prev, AuthorizationInfo prxy)
throws IOException;


/**
* This method is similar to <code>handleAuthHeaders</code> except that
* it is called if any headers in the trailer were sent. This also
* implies that it is invoked after any <code>fixupAuthInfo()</code> or
* <code>getAuthorization()</code> invocation.
*
* @param resp the full Response
* @param req the Request which provoked this response
* @param prev the previous auth info sent, or null if none was sent
* @param prxy the previous proxy auth info sent, or null if none was sent
* @exception IOException if an exception occurs during the reading of
* the trailers.
* @see #handleAuthHeaders(HTTPClient.Response, HTTPClient.RoRequest, HTTPClient.AuthorizationInfo, HTTPClient.AuthorizationInfo)
*/
void handleAuthTrailers(Response resp, RoRequest req,
AuthorizationInfo prev, AuthorizationInfo prxy)
throws IOException;
}

0 comments on commit 0a4cc64

Please sign in to comment.