diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2010-06-03 19:11:10 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2010-06-03 19:11:10 +0000 |
commit | a17284098845d59d84bbf76b33190a5a91c12a82 (patch) | |
tree | c634c40062604cd1cdefa535b838926c9ede1a38 /gnu/java/net/protocol | |
parent | 43b6a8d2580b5c9549a58db41a0239f3929e4b91 (diff) | |
download | classpath-a17284098845d59d84bbf76b33190a5a91c12a82.tar.gz |
Normalise whitespace.
2010-06-03 Andrew John Hughes <ahughes@redhat.com>
* examples/gnu/classpath/examples/CORBA/NamingService/Demo.java,
* examples/gnu/classpath/examples/CORBA/SimpleCommunication/Demo.java,
* examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/StructureToPass.java,
* examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/StructureToReturn.java,
* examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/TreeNode.java,
* examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/WeThrowThisException.java,
* examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/WeThrowThisExceptionHelper.java,
* examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_DemoTesterImplBase.java,
* examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/_DemoTesterStub.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/CanvasWorld.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/ChatConstants.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/ClientFrame.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/Demo.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/GameManager.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/GameManagerImpl.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/IorReader.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/OrbStarter.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/Player.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/PlayerImpl.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/PlayingDesk.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/State.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/X5Server.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/_GameManagerImpl_Tie.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/_GameManager_Stub.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/_PlayerImpl_Tie.java,
* examples/gnu/classpath/examples/CORBA/swing/x5/_Player_Stub.java,
* examples/gnu/classpath/examples/awt/AicasGraphicsBenchmark.java,
* examples/gnu/classpath/examples/awt/Demo.java,
* examples/gnu/classpath/examples/awt/HintingDemo.java,
* examples/gnu/classpath/examples/datatransfer/Demo.java,
* examples/gnu/classpath/examples/html/Demo.java,
* examples/gnu/classpath/examples/java2d/J2dBenchmark.java,
* examples/gnu/classpath/examples/java2d/J2dBenchmarkGUI.java,
* examples/gnu/classpath/examples/java2d/JNIOverhead.java,
* examples/gnu/classpath/examples/jawt/DemoJAWT.java,
* examples/gnu/classpath/examples/management/TestClassLoading.java,
* examples/gnu/classpath/examples/management/TestCompilation.java,
* examples/gnu/classpath/examples/management/TestGarbageCollector.java,
* examples/gnu/classpath/examples/management/TestMemory.java,
* examples/gnu/classpath/examples/management/TestMemoryManager.java,
* examples/gnu/classpath/examples/management/TestMemoryPool.java,
* examples/gnu/classpath/examples/management/TestThread.java,
* examples/gnu/classpath/examples/midi/Demo.java,
* examples/gnu/classpath/examples/print/Demo.java,
* examples/gnu/classpath/examples/sound/AudioPlayerSample.java,
* examples/gnu/classpath/examples/swing/BrowserEditorKit.java,
* examples/gnu/classpath/examples/swing/ButtonDemo.java,
* examples/gnu/classpath/examples/swing/ComboBoxDemo.java,
* examples/gnu/classpath/examples/swing/Demo.java,
* examples/gnu/classpath/examples/swing/DemoFactory.java,
* examples/gnu/classpath/examples/swing/DocumentFilterDemo.java,
* examples/gnu/classpath/examples/swing/FileChooserDemo.java,
* examples/gnu/classpath/examples/swing/HtmlDemo.java,
* examples/gnu/classpath/examples/swing/ListDemo.java,
* examples/gnu/classpath/examples/swing/MetalThemeEditor.java,
* examples/gnu/classpath/examples/swing/NavigationFilterDemo.java,
* examples/gnu/classpath/examples/swing/ScrollBarDemo.java,
* examples/gnu/classpath/examples/swing/SliderDemo.java,
* examples/gnu/classpath/examples/swing/SpinnerDemo.java,
* examples/gnu/classpath/examples/swing/TabbedPaneDemo.java,
* examples/gnu/classpath/examples/swing/TableDemo.java,
* examples/gnu/classpath/examples/swing/TextAreaDemo.java,
* examples/gnu/classpath/examples/swing/TextFieldDemo.java,
* examples/gnu/classpath/examples/swing/TreeDemo.java,
* gnu/CORBA/BigDecimalHelper.java,
* gnu/CORBA/CDR/AbstractCdrInput.java,
* gnu/CORBA/CDR/AbstractCdrOutput.java,
* gnu/CORBA/CDR/AbstractDataInput.java,
* gnu/CORBA/CDR/AbstractDataOutput.java,
* gnu/CORBA/CDR/AligningInput.java,
* gnu/CORBA/CDR/AligningOutput.java,
* gnu/CORBA/CDR/ArrayValueHelper.java,
* gnu/CORBA/CDR/BigEndianInputStream.java,
* gnu/CORBA/CDR/BigEndianOutputStream.java,
* gnu/CORBA/CDR/BufferedCdrOutput.java,
* gnu/CORBA/CDR/BufferredCdrInput.java,
* gnu/CORBA/CDR/HeadlessInput.java,
* gnu/CORBA/CDR/IDLTypeHelper.java,
* gnu/CORBA/CDR/LittleEndianOutputStream.java,
* gnu/CORBA/CDR/UnknownExceptionCtxHandler.java,
* gnu/CORBA/CDR/VMVio.java,
* gnu/CORBA/CDR/Vio.java,
* gnu/CORBA/CDR/gnuRuntime.java,
* gnu/CORBA/CDR/gnuValueStream.java,
* gnu/CORBA/CdrEncapsCodecImpl.java,
* gnu/CORBA/CollocatedOrbs.java,
* gnu/CORBA/Connected_objects.java,
* gnu/CORBA/DefaultSocketFactory.java,
* gnu/CORBA/DuplicateNameHolder.java,
* gnu/CORBA/DynAn/AbstractAny.java,
* gnu/CORBA/DynAn/DivideableAny.java,
* gnu/CORBA/DynAn/NameValuePairHolder.java,
* gnu/CORBA/DynAn/RecordAny.java,
* gnu/CORBA/DynAn/ValueChangeListener.java,
* gnu/CORBA/DynAn/gnuDynAny.java,
* gnu/CORBA/DynAn/gnuDynAnyFactory.java,
* gnu/CORBA/DynAn/gnuDynArray.java,
* gnu/CORBA/DynAn/gnuDynEnum.java,
* gnu/CORBA/DynAn/gnuDynFixed.java,
* gnu/CORBA/DynAn/gnuDynSequence.java,
* gnu/CORBA/DynAn/gnuDynUnion.java,
* gnu/CORBA/DynAn/gnuDynValue.java,
* gnu/CORBA/DynAn/gnuDynValueBox.java,
* gnu/CORBA/DynAnySeqHolder.java,
* gnu/CORBA/EmptyExceptionHolder.java,
* gnu/CORBA/ForwardRequestHelper.java,
* gnu/CORBA/GIOP/CharSets_OSF.java,
* gnu/CORBA/GIOP/CloseMessage.java,
* gnu/CORBA/GIOP/ErrorMessage.java,
* gnu/CORBA/GIOP/MessageHeader.java,
* gnu/CORBA/GIOP/ServiceContext.java,
* gnu/CORBA/GIOP/v1_2/RequestHeader.java,
* gnu/CORBA/GeneralHolder.java,
* gnu/CORBA/IOR.java,
* gnu/CORBA/Interceptor/ClientRequestInterceptors.java,
* gnu/CORBA/Interceptor/ForwardRequestHolder.java,
* gnu/CORBA/Interceptor/IORInterceptors.java,
* gnu/CORBA/Interceptor/Registrator.java,
* gnu/CORBA/Interceptor/ServerRequestInterceptors.java,
* gnu/CORBA/Interceptor/gnuClientRequestInfo.java,
* gnu/CORBA/Interceptor/gnuIcCurrent.java,
* gnu/CORBA/Interceptor/gnuIorInfo.java,
* gnu/CORBA/Interceptor/gnuServerRequestInfo.java,
* gnu/CORBA/IorDelegate.java,
* gnu/CORBA/IorObject.java,
* gnu/CORBA/Minor.java,
* gnu/CORBA/NameDynAnyPairHolder.java,
* gnu/CORBA/NameDynAnyPairSeqHolder.java,
* gnu/CORBA/NameValuePairHolder.java,
* gnu/CORBA/NameValuePairSeqHolder.java,
* gnu/CORBA/NamingService/NameParser.java,
* gnu/CORBA/NamingService/NamingMap.java,
* gnu/CORBA/NamingService/NamingServiceTransient.java,
* gnu/CORBA/NamingService/TransientContext.java,
* gnu/CORBA/ObjectCreator.java,
* gnu/CORBA/OrbFocused.java,
* gnu/CORBA/OrbFunctional.java,
* gnu/CORBA/OrbRestricted.java,
* gnu/CORBA/Poa/AOM.java,
* gnu/CORBA/Poa/AccessiblePolicy.java,
* gnu/CORBA/Poa/DynamicImpHandler.java,
* gnu/CORBA/Poa/ForwardRequestHolder.java,
* gnu/CORBA/Poa/ForwardedServant.java,
* gnu/CORBA/Poa/InvalidPolicyHolder.java,
* gnu/CORBA/Poa/LocalDelegate.java,
* gnu/CORBA/Poa/LocalRequest.java,
* gnu/CORBA/Poa/LocalServerRequest.java,
* gnu/CORBA/Poa/ORB_1_4.java,
* gnu/CORBA/Poa/ServantDelegateImpl.java,
* gnu/CORBA/Poa/StandardPolicies.java,
* gnu/CORBA/Poa/gnuAdapterActivator.java,
* gnu/CORBA/Poa/gnuForwardRequest.java,
* gnu/CORBA/Poa/gnuIdAssignmentPolicy.java,
* gnu/CORBA/Poa/gnuIdUniquenessPolicy.java,
* gnu/CORBA/Poa/gnuImplicitActivationPolicy.java,
* gnu/CORBA/Poa/gnuLifespanPolicy.java,
* gnu/CORBA/Poa/gnuPOA.java,
* gnu/CORBA/Poa/gnuPOAManager.java,
* gnu/CORBA/Poa/gnuPoaCurrent.java,
* gnu/CORBA/Poa/gnuRequestProcessingPolicy.java,
* gnu/CORBA/Poa/gnuServantObject.java,
* gnu/CORBA/Poa/gnuServantRetentionPolicy.java,
* gnu/CORBA/Poa/gnuThreadPolicy.java,
* gnu/CORBA/ServiceRequestAdapter.java,
* gnu/CORBA/SetOverrideTypeHolder.java,
* gnu/CORBA/SimpleDelegate.java,
* gnu/CORBA/SocketRepository.java,
* gnu/CORBA/StreamHolder.java,
* gnu/CORBA/TypeCodeHelper.java,
* gnu/CORBA/TypeKindNamer.java,
* gnu/CORBA/Version.java,
* gnu/CORBA/_PolicyImplBase.java,
* gnu/CORBA/gnuAny.java,
* gnu/CORBA/gnuCodecFactory.java,
* gnu/CORBA/gnuEnvironment.java,
* gnu/CORBA/gnuRequest.java,
* gnu/CORBA/gnuValueHolder.java,
* gnu/CORBA/interfaces/SocketFactory.java,
* gnu/CORBA/typecodes/AliasTypeCode.java,
* gnu/CORBA/typecodes/ArrayTypeCode.java,
* gnu/CORBA/typecodes/FixedTypeCode.java,
* gnu/CORBA/typecodes/GeneralTypeCode.java,
* gnu/CORBA/typecodes/PrimitiveTypeCode.java,
* gnu/CORBA/typecodes/RecordTypeCode.java,
* gnu/CORBA/typecodes/RecursiveTypeCode.java,
* gnu/CORBA/typecodes/StringTypeCode.java,
* gnu/classpath/Pair.java,
* gnu/classpath/Pointer.java,
* gnu/classpath/Pointer32.java,
* gnu/classpath/Pointer64.java,
* gnu/classpath/ServiceFactory.java,
* gnu/classpath/ServiceProviderLoadingAction.java,
* gnu/classpath/SystemProperties.java,
* gnu/classpath/debug/Component.java,
* gnu/classpath/debug/PreciseFilter.java,
* gnu/classpath/debug/SystemLogger.java,
* gnu/classpath/debug/TeeInputStream.java,
* gnu/classpath/debug/TeeReader.java,
* gnu/classpath/jdwp/Jdwp.java,
* gnu/classpath/jdwp/JdwpConstants.java,
* gnu/classpath/jdwp/event/BreakpointEvent.java,
* gnu/classpath/jdwp/event/ClassPrepareEvent.java,
* gnu/classpath/jdwp/event/ClassUnloadEvent.java,
* gnu/classpath/jdwp/event/Event.java,
* gnu/classpath/jdwp/event/EventManager.java,
* gnu/classpath/jdwp/event/EventRequest.java,
* gnu/classpath/jdwp/event/ExceptionEvent.java,
* gnu/classpath/jdwp/event/MethodEntryEvent.java,
* gnu/classpath/jdwp/event/MethodExitEvent.java,
* gnu/classpath/jdwp/event/SingleStepEvent.java,
* gnu/classpath/jdwp/event/ThreadEndEvent.java,
* gnu/classpath/jdwp/event/VmDeathEvent.java,
* gnu/classpath/jdwp/event/VmInitEvent.java,
* gnu/classpath/jdwp/event/filters/ClassExcludeFilter.java,
* gnu/classpath/jdwp/event/filters/ClassMatchFilter.java,
* gnu/classpath/jdwp/event/filters/ClassOnlyFilter.java,
* gnu/classpath/jdwp/event/filters/ExceptionOnlyFilter.java,
* gnu/classpath/jdwp/event/filters/FieldOnlyFilter.java,
* gnu/classpath/jdwp/event/filters/InstanceOnlyFilter.java,
* gnu/classpath/jdwp/event/filters/StepFilter.java,
* gnu/classpath/jdwp/event/filters/ThreadOnlyFilter.java,
* gnu/classpath/jdwp/exception/InvalidClassException.java,
* gnu/classpath/jdwp/exception/InvalidClassLoaderException.java,
* gnu/classpath/jdwp/exception/InvalidEventTypeException.java,
* gnu/classpath/jdwp/exception/InvalidFieldException.java,
* gnu/classpath/jdwp/exception/InvalidFrameException.java,
* gnu/classpath/jdwp/exception/InvalidLocationException.java,
* gnu/classpath/jdwp/exception/InvalidMethodException.java,
* gnu/classpath/jdwp/exception/InvalidObjectException.java,
* gnu/classpath/jdwp/exception/InvalidSlotException.java,
* gnu/classpath/jdwp/exception/InvalidStringException.java,
* gnu/classpath/jdwp/exception/InvalidThreadException.java,
* gnu/classpath/jdwp/exception/InvalidThreadGroupException.java,
* gnu/classpath/jdwp/exception/NativeMethodException.java,
* gnu/classpath/jdwp/exception/NotImplementedException.java,
* gnu/classpath/jdwp/id/JdwpId.java,
* gnu/classpath/jdwp/id/NullObjectId.java,
* gnu/classpath/jdwp/processor/ArrayReferenceCommandSet.java,
* gnu/classpath/jdwp/processor/ArrayTypeCommandSet.java,
* gnu/classpath/jdwp/processor/ClassLoaderReferenceCommandSet.java,
* gnu/classpath/jdwp/processor/ClassObjectReferenceCommandSet.java,
* gnu/classpath/jdwp/processor/ClassTypeCommandSet.java,
* gnu/classpath/jdwp/processor/CommandSet.java,
* gnu/classpath/jdwp/processor/EventRequestCommandSet.java,
* gnu/classpath/jdwp/processor/FieldCommandSet.java,
* gnu/classpath/jdwp/processor/InterfaceTypeCommandSet.java,
* gnu/classpath/jdwp/processor/MethodCommandSet.java,
* gnu/classpath/jdwp/processor/ObjectReferenceCommandSet.java,
* gnu/classpath/jdwp/processor/PacketProcessor.java,
* gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java,
* gnu/classpath/jdwp/processor/StackFrameCommandSet.java,
* gnu/classpath/jdwp/processor/StringReferenceCommandSet.java,
* gnu/classpath/jdwp/processor/ThreadGroupReferenceCommandSet.java,
* gnu/classpath/jdwp/processor/ThreadReferenceCommandSet.java,
* gnu/classpath/jdwp/processor/VirtualMachineCommandSet.java,
* gnu/classpath/jdwp/transport/JdwpCommandPacket.java,
* gnu/classpath/jdwp/transport/JdwpConnection.java,
* gnu/classpath/jdwp/transport/JdwpPacket.java,
* gnu/classpath/jdwp/transport/JdwpReplyPacket.java,
* gnu/classpath/jdwp/transport/SocketTransport.java,
* gnu/classpath/jdwp/transport/TransportFactory.java,
* gnu/classpath/jdwp/util/JdwpString.java,
* gnu/classpath/jdwp/util/LineTable.java,
* gnu/classpath/jdwp/util/Location.java,
* gnu/classpath/jdwp/util/MethodResult.java,
* gnu/classpath/jdwp/util/MonitorInfo.java,
* gnu/classpath/jdwp/util/Signature.java,
* gnu/classpath/jdwp/util/VariableTable.java,
* gnu/classpath/jdwp/value/ArrayValue.java,
* gnu/classpath/jdwp/value/BooleanValue.java,
* gnu/classpath/jdwp/value/ByteValue.java,
* gnu/classpath/jdwp/value/CharValue.java,
* gnu/classpath/jdwp/value/DoubleValue.java,
* gnu/classpath/jdwp/value/FloatValue.java,
* gnu/classpath/jdwp/value/IntValue.java,
* gnu/classpath/jdwp/value/LongValue.java,
* gnu/classpath/jdwp/value/ObjectValue.java,
* gnu/classpath/jdwp/value/ShortValue.java,
* gnu/classpath/jdwp/value/StringValue.java,
* gnu/classpath/jdwp/value/Value.java,
* gnu/classpath/jdwp/value/ValueFactory.java,
* gnu/classpath/jdwp/value/VoidValue.java,
* gnu/classpath/toolkit/DefaultDaemonThreadFactory.java,
* gnu/java/awt/AWTUtilities.java,
* gnu/java/awt/BitMaskExtent.java,
* gnu/java/awt/BitwiseXORComposite.java,
* gnu/java/awt/Buffers.java,
* gnu/java/awt/ClasspathGraphicsEnvironment.java,
* gnu/java/awt/ClasspathToolkit.java,
* gnu/java/awt/ComponentDataBlitOp.java,
* gnu/java/awt/EmbeddedWindow.java,
* gnu/java/awt/GradientPaintContext.java,
* gnu/java/awt/color/CieXyzConverter.java,
* gnu/java/awt/color/ClutProfileConverter.java,
* gnu/java/awt/color/ColorLookUpTable.java,
* gnu/java/awt/color/GrayProfileConverter.java,
* gnu/java/awt/color/GrayScaleConverter.java,
* gnu/java/awt/color/LinearRGBConverter.java,
* gnu/java/awt/color/ProfileHeader.java,
* gnu/java/awt/color/RgbProfileConverter.java,
* gnu/java/awt/color/SrgbConverter.java,
* gnu/java/awt/color/ToneReproductionCurve.java,
* gnu/java/awt/dnd/GtkMouseDragGestureRecognizer.java,
* gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java,
* gnu/java/awt/dnd/peer/gtk/GtkDropTargetContextPeer.java,
* gnu/java/awt/dnd/peer/gtk/GtkDropTargetPeer.java,
* gnu/java/awt/font/FontDelegate.java,
* gnu/java/awt/font/FontFactory.java,
* gnu/java/awt/font/GNUGlyphVector.java,
* gnu/java/awt/font/OpenTypeFontPeer.java,
* gnu/java/awt/font/autofit/GlyphHints.java,
* gnu/java/awt/font/autofit/Latin.java,
* gnu/java/awt/font/autofit/Utils.java,
* gnu/java/awt/font/opentype/CharGlyphMap.java,
* gnu/java/awt/font/opentype/GlyphNamer.java,
* gnu/java/awt/font/opentype/MacResourceFork.java,
* gnu/java/awt/font/opentype/NameDecoder.java,
* gnu/java/awt/font/opentype/OpenTypeFont.java,
* gnu/java/awt/font/opentype/OpenTypeFontFactory.java,
* gnu/java/awt/font/opentype/truetype/GlyphLoader.java,
* gnu/java/awt/font/opentype/truetype/GlyphLocator.java,
* gnu/java/awt/font/opentype/truetype/GlyphMeasurer.java,
* gnu/java/awt/font/opentype/truetype/Point.java,
* gnu/java/awt/font/opentype/truetype/TrueTypeScaler.java,
* gnu/java/awt/font/opentype/truetype/VirtualMachine.java,
* gnu/java/awt/font/opentype/truetype/Zone.java,
* gnu/java/awt/font/opentype/truetype/ZonePathIterator.java,
* gnu/java/awt/image/AsyncImage.java,
* gnu/java/awt/image/ImageConverter.java,
* gnu/java/awt/image/ImageDecoder.java,
* gnu/java/awt/image/XBMDecoder.java,
* gnu/java/awt/java2d/AbstractGraphics2D.java,
* gnu/java/awt/java2d/AlphaCompositeContext.java,
* gnu/java/awt/java2d/CubicSegment.java,
* gnu/java/awt/java2d/LineSegment.java,
* gnu/java/awt/java2d/PixelCoverage.java,
* gnu/java/awt/java2d/QuadSegment.java,
* gnu/java/awt/java2d/RasterGraphics.java,
* gnu/java/awt/java2d/ScanlineConverter.java,
* gnu/java/awt/java2d/ScanlineCoverage.java,
* gnu/java/awt/java2d/Segment.java,
* gnu/java/awt/java2d/TexturePaintContext.java,
* gnu/java/awt/peer/ClasspathDesktopPeer.java,
* gnu/java/awt/peer/ClasspathFontPeer.java,
* gnu/java/awt/peer/GLightweightPeer.java,
* gnu/java/awt/peer/GnomeDesktopPeer.java,
* gnu/java/awt/peer/KDEDesktopPeer.java,
* gnu/java/awt/peer/gtk/AsyncImage.java,
* gnu/java/awt/peer/gtk/BufferedImageGraphics.java,
* gnu/java/awt/peer/gtk/CairoGraphics2D.java,
* gnu/java/awt/peer/gtk/CairoSurface.java,
* gnu/java/awt/peer/gtk/CairoSurfaceGraphics.java,
* gnu/java/awt/peer/gtk/ComponentGraphics.java,
* gnu/java/awt/peer/gtk/ComponentGraphicsCopy.java,
* gnu/java/awt/peer/gtk/FreetypeGlyphVector.java,
* gnu/java/awt/peer/gtk/GdkFontPeer.java,
* gnu/java/awt/peer/gtk/GdkGraphicsConfiguration.java,
* gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java,
* gnu/java/awt/peer/gtk/GdkPixbufDecoder.java,
* gnu/java/awt/peer/gtk/GdkRobotPeer.java,
* gnu/java/awt/peer/gtk/GdkScreenGraphicsDevice.java,
* gnu/java/awt/peer/gtk/GtkButtonPeer.java,
* gnu/java/awt/peer/gtk/GtkCheckboxPeer.java,
* gnu/java/awt/peer/gtk/GtkChoicePeer.java,
* gnu/java/awt/peer/gtk/GtkClipboard.java,
* gnu/java/awt/peer/gtk/GtkComponentPeer.java,
* gnu/java/awt/peer/gtk/GtkContainerPeer.java,
* gnu/java/awt/peer/gtk/GtkCursor.java,
* gnu/java/awt/peer/gtk/GtkDialogPeer.java,
* gnu/java/awt/peer/gtk/GtkFileDialogPeer.java,
* gnu/java/awt/peer/gtk/GtkFramePeer.java,
* gnu/java/awt/peer/gtk/GtkGenericPeer.java,
* gnu/java/awt/peer/gtk/GtkImage.java,
* gnu/java/awt/peer/gtk/GtkImageConsumer.java,
* gnu/java/awt/peer/gtk/GtkLabelPeer.java,
* gnu/java/awt/peer/gtk/GtkListPeer.java,
* gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java,
* gnu/java/awt/peer/gtk/GtkMenuPeer.java,
* gnu/java/awt/peer/gtk/GtkMouseInfoPeer.java,
* gnu/java/awt/peer/gtk/GtkPanelPeer.java,
* gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java,
* gnu/java/awt/peer/gtk/GtkScrollbarPeer.java,
* gnu/java/awt/peer/gtk/GtkSelection.java,
* gnu/java/awt/peer/gtk/GtkToolkit.java,
* gnu/java/awt/peer/gtk/GtkVolatileImage.java,
* gnu/java/awt/peer/gtk/GtkWindowPeer.java,
* gnu/java/awt/peer/gtk/VolatileImageGraphics.java,
* gnu/java/awt/peer/headless/HeadlessGraphicsEnvironment.java,
* gnu/java/awt/peer/qt/MainQtThread.java,
* gnu/java/awt/peer/qt/QMatrix.java,
* gnu/java/awt/peer/qt/QPainterPath.java,
* gnu/java/awt/peer/qt/QPen.java,
* gnu/java/awt/peer/qt/QtAudioClip.java,
* gnu/java/awt/peer/qt/QtButtonPeer.java,
* gnu/java/awt/peer/qt/QtCheckboxPeer.java,
* gnu/java/awt/peer/qt/QtChoicePeer.java,
* gnu/java/awt/peer/qt/QtComponentGraphics.java,
* gnu/java/awt/peer/qt/QtComponentPeer.java,
* gnu/java/awt/peer/qt/QtContainerPeer.java,
* gnu/java/awt/peer/qt/QtDialogPeer.java,
* gnu/java/awt/peer/qt/QtEmbeddedWindowPeer.java,
* gnu/java/awt/peer/qt/QtFileDialogPeer.java,
* gnu/java/awt/peer/qt/QtFontMetrics.java,
* gnu/java/awt/peer/qt/QtFontPeer.java,
* gnu/java/awt/peer/qt/QtFramePeer.java,
* gnu/java/awt/peer/qt/QtGraphics.java,
* gnu/java/awt/peer/qt/QtGraphicsEnvironment.java,
* gnu/java/awt/peer/qt/QtImage.java,
* gnu/java/awt/peer/qt/QtImageConsumer.java,
* gnu/java/awt/peer/qt/QtImageDirectGraphics.java,
* gnu/java/awt/peer/qt/QtImageGraphics.java,
* gnu/java/awt/peer/qt/QtLabelPeer.java,
* gnu/java/awt/peer/qt/QtListPeer.java,
* gnu/java/awt/peer/qt/QtMenuBarPeer.java,
* gnu/java/awt/peer/qt/QtMenuComponentPeer.java,
* gnu/java/awt/peer/qt/QtMenuItemPeer.java,
* gnu/java/awt/peer/qt/QtMenuPeer.java,
* gnu/java/awt/peer/qt/QtPanelPeer.java,
* gnu/java/awt/peer/qt/QtPopupMenuPeer.java,
* gnu/java/awt/peer/qt/QtRepaintThread.java,
* gnu/java/awt/peer/qt/QtScreenDevice.java,
* gnu/java/awt/peer/qt/QtScreenDeviceConfiguration.java,
* gnu/java/awt/peer/qt/QtScrollPanePeer.java,
* gnu/java/awt/peer/qt/QtScrollbarPeer.java,
* gnu/java/awt/peer/qt/QtTextAreaPeer.java,
* gnu/java/awt/peer/qt/QtTextFieldPeer.java,
* gnu/java/awt/peer/qt/QtToolkit.java,
* gnu/java/awt/peer/qt/QtVolatileImage.java,
* gnu/java/awt/peer/qt/QtWindowPeer.java,
* gnu/java/awt/peer/swing/SwingButtonPeer.java,
* gnu/java/awt/peer/swing/SwingCheckboxPeer.java,
* gnu/java/awt/peer/swing/SwingComponent.java,
* gnu/java/awt/peer/swing/SwingComponentPeer.java,
* gnu/java/awt/peer/swing/SwingContainerPeer.java,
* gnu/java/awt/peer/swing/SwingLabelPeer.java,
* gnu/java/awt/peer/swing/SwingListPeer.java,
* gnu/java/awt/peer/swing/SwingMenuItemPeer.java,
* gnu/java/awt/peer/swing/SwingMenuPeer.java,
* gnu/java/awt/peer/swing/SwingTextAreaPeer.java,
* gnu/java/awt/peer/swing/SwingTextFieldPeer.java,
* gnu/java/awt/peer/x/GLGraphics.java,
* gnu/java/awt/peer/x/KeyboardMapping.java,
* gnu/java/awt/peer/x/XEventPump.java,
* gnu/java/awt/peer/x/XFontPeer.java,
* gnu/java/awt/peer/x/XFramePeer.java,
* gnu/java/awt/peer/x/XGraphics2D.java,
* gnu/java/awt/peer/x/XGraphicsConfiguration.java,
* gnu/java/awt/peer/x/XGraphicsDevice.java,
* gnu/java/awt/peer/x/XGraphicsEnvironment.java,
* gnu/java/awt/peer/x/XImage.java,
* gnu/java/awt/peer/x/XToolkit.java,
* gnu/java/awt/peer/x/XWindowPeer.java,
* gnu/java/awt/print/JavaPrinterGraphics.java,
* gnu/java/awt/print/JavaPrinterJob.java,
* gnu/java/awt/print/PostScriptGraphics2D.java,
* gnu/java/awt/print/SpooledDocument.java,
* gnu/java/beans/BeanInfoEmbryo.java,
* gnu/java/beans/DefaultExceptionListener.java,
* gnu/java/beans/ExplicitBeanInfo.java,
* gnu/java/beans/IntrospectionIncubator.java,
* gnu/java/beans/decoder/AbstractContext.java,
* gnu/java/beans/decoder/AbstractCreatableObjectContext.java,
* gnu/java/beans/decoder/AbstractElementHandler.java,
* gnu/java/beans/decoder/AbstractObjectContext.java,
* gnu/java/beans/decoder/ArrayContext.java,
* gnu/java/beans/decoder/ArrayHandler.java,
* gnu/java/beans/decoder/AssemblyException.java,
* gnu/java/beans/decoder/BooleanHandler.java,
* gnu/java/beans/decoder/ByteHandler.java,
* gnu/java/beans/decoder/CharHandler.java,
* gnu/java/beans/decoder/ClassHandler.java,
* gnu/java/beans/decoder/ConstructorContext.java,
* gnu/java/beans/decoder/Context.java,
* gnu/java/beans/decoder/DecoderContext.java,
* gnu/java/beans/decoder/DoubleHandler.java,
* gnu/java/beans/decoder/DummyContext.java,
* gnu/java/beans/decoder/DummyHandler.java,
* gnu/java/beans/decoder/ElementHandler.java,
* gnu/java/beans/decoder/FloatHandler.java,
* gnu/java/beans/decoder/GrowableArrayContext.java,
* gnu/java/beans/decoder/IndexContext.java,
* gnu/java/beans/decoder/IntHandler.java,
* gnu/java/beans/decoder/JavaHandler.java,
* gnu/java/beans/decoder/LongHandler.java,
* gnu/java/beans/decoder/MethodContext.java,
* gnu/java/beans/decoder/MethodFinder.java,
* gnu/java/beans/decoder/NullHandler.java,
* gnu/java/beans/decoder/ObjectContext.java,
* gnu/java/beans/decoder/ObjectHandler.java,
* gnu/java/beans/decoder/PersistenceParser.java,
* gnu/java/beans/decoder/PropertyContext.java,
* gnu/java/beans/decoder/ShortHandler.java,
* gnu/java/beans/decoder/SimpleHandler.java,
* gnu/java/beans/decoder/StaticMethodContext.java,
* gnu/java/beans/decoder/StringHandler.java,
* gnu/java/beans/decoder/VoidHandler.java,
* gnu/java/beans/editors/ColorEditor.java,
* gnu/java/beans/editors/FontEditor.java,
* gnu/java/beans/editors/NativeBooleanEditor.java,
* gnu/java/beans/editors/NativeByteEditor.java,
* gnu/java/beans/editors/NativeDoubleEditor.java,
* gnu/java/beans/editors/NativeFloatEditor.java,
* gnu/java/beans/editors/NativeIntEditor.java,
* gnu/java/beans/editors/NativeLongEditor.java,
* gnu/java/beans/editors/NativeShortEditor.java,
* gnu/java/beans/editors/StringEditor.java,
* gnu/java/beans/encoder/ArrayPersistenceDelegate.java,
* gnu/java/beans/encoder/ClassPersistenceDelegate.java,
* gnu/java/beans/encoder/CollectionPersistenceDelegate.java,
* gnu/java/beans/encoder/Context.java,
* gnu/java/beans/encoder/GenericScannerState.java,
* gnu/java/beans/encoder/IgnoringScannerState.java,
* gnu/java/beans/encoder/MapPersistenceDelegate.java,
* gnu/java/beans/encoder/ObjectId.java,
* gnu/java/beans/encoder/PrimitivePersistenceDelegate.java,
* gnu/java/beans/encoder/ReportingScannerState.java,
* gnu/java/beans/encoder/Root.java,
* gnu/java/beans/encoder/ScanEngine.java,
* gnu/java/beans/encoder/ScannerState.java,
* gnu/java/beans/encoder/StAXWriter.java,
* gnu/java/beans/encoder/Writer.java,
* gnu/java/beans/encoder/elements/ArrayInstantiation.java,
* gnu/java/beans/encoder/elements/Array_Get.java,
* gnu/java/beans/encoder/elements/ClassResolution.java,
* gnu/java/beans/encoder/elements/Element.java,
* gnu/java/beans/encoder/elements/List_Get.java,
* gnu/java/beans/encoder/elements/List_Set.java,
* gnu/java/beans/encoder/elements/MethodInvocation.java,
* gnu/java/beans/encoder/elements/NullObject.java,
* gnu/java/beans/encoder/elements/ObjectInstantiation.java,
* gnu/java/beans/encoder/elements/ObjectReference.java,
* gnu/java/beans/encoder/elements/PrimitiveInstantiation.java,
* gnu/java/beans/encoder/elements/StaticFieldAccess.java,
* gnu/java/beans/encoder/elements/StaticMethodInvocation.java,
* gnu/java/beans/encoder/elements/StringReference.java,
* gnu/java/io/ASN1ParsingException.java,
* gnu/java/io/Base64InputStream.java,
* gnu/java/io/ClassLoaderObjectInputStream.java,
* gnu/java/io/NullOutputStream.java,
* gnu/java/io/ObjectIdentityMap2Int.java,
* gnu/java/io/ObjectIdentityWrapper.java,
* gnu/java/io/PlatformHelper.java,
* gnu/java/lang/CPStringBuilder.java,
* gnu/java/lang/CharData.java,
* gnu/java/lang/InstrumentationImpl.java,
* gnu/java/lang/MainThread.java,
* gnu/java/lang/management/BeanImpl.java,
* gnu/java/lang/management/ClassLoadingMXBeanImpl.java,
* gnu/java/lang/management/CompilationMXBeanImpl.java,
* gnu/java/lang/management/GarbageCollectorMXBeanImpl.java,
* gnu/java/lang/management/MemoryMXBeanImpl.java,
* gnu/java/lang/management/MemoryManagerMXBeanImpl.java,
* gnu/java/lang/management/MemoryPoolMXBeanImpl.java,
* gnu/java/lang/management/OperatingSystemMXBeanImpl.java,
* gnu/java/lang/management/RuntimeMXBeanImpl.java,
* gnu/java/lang/management/ThreadMXBeanImpl.java,
* gnu/java/lang/reflect/TypeSignature.java,
* gnu/java/locale/LocaleHelper.java,
* gnu/java/math/Fixed.java,
* gnu/java/math/GMP.java,
* gnu/java/math/MPN.java,
* gnu/java/net/CRLFInputStream.java,
* gnu/java/net/CRLFOutputStream.java,
* gnu/java/net/DefaultContentHandlerFactory.java,
* gnu/java/net/DefaultProxySelector.java,
* gnu/java/net/EmptyX509TrustManager.java,
* gnu/java/net/GetLocalHostAction.java,
* gnu/java/net/HeaderFieldHelper.java,
* gnu/java/net/IndexListParser.java,
* gnu/java/net/LineInputStream.java,
* gnu/java/net/PlainDatagramSocketImpl.java,
* gnu/java/net/PlainSocketImpl.java,
* gnu/java/net/loader/FileResource.java,
* gnu/java/net/loader/FileURLLoader.java,
* gnu/java/net/loader/JarURLLoader.java,
* gnu/java/net/loader/JarURLResource.java,
* gnu/java/net/loader/RemoteResource.java,
* gnu/java/net/loader/RemoteURLLoader.java,
* gnu/java/net/loader/Resource.java,
* gnu/java/net/loader/URLLoader.java,
* gnu/java/net/protocol/file/Connection.java,
* gnu/java/net/protocol/file/Handler.java,
* gnu/java/net/protocol/ftp/ActiveModeDTP.java,
* gnu/java/net/protocol/ftp/BlockInputStream.java,
* gnu/java/net/protocol/ftp/BlockOutputStream.java,
* gnu/java/net/protocol/ftp/CompressedInputStream.java,
* gnu/java/net/protocol/ftp/CompressedOutputStream.java,
* gnu/java/net/protocol/ftp/DTP.java,
* gnu/java/net/protocol/ftp/DTPInputStream.java,
* gnu/java/net/protocol/ftp/DTPOutputStream.java,
* gnu/java/net/protocol/ftp/FTPConnection.java,
* gnu/java/net/protocol/ftp/FTPException.java,
* gnu/java/net/protocol/ftp/FTPResponse.java,
* gnu/java/net/protocol/ftp/FTPURLConnection.java,
* gnu/java/net/protocol/ftp/Handler.java,
* gnu/java/net/protocol/ftp/PassiveModeDTP.java,
* gnu/java/net/protocol/ftp/StreamInputStream.java,
* gnu/java/net/protocol/ftp/StreamOutputStream.java,
* gnu/java/net/protocol/http/Authenticator.java,
* gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java,
* gnu/java/net/protocol/http/ChunkedInputStream.java,
* gnu/java/net/protocol/http/Cookie.java,
* gnu/java/net/protocol/http/CookieManager.java,
* gnu/java/net/protocol/http/Credentials.java,
* gnu/java/net/protocol/http/HTTPConnection.java,
* gnu/java/net/protocol/http/HTTPDateFormat.java,
* gnu/java/net/protocol/http/HTTPURLConnection.java,
* gnu/java/net/protocol/http/Handler.java,
* gnu/java/net/protocol/http/Headers.java,
* gnu/java/net/protocol/http/Request.java,
* gnu/java/net/protocol/http/RequestBodyWriter.java,
* gnu/java/net/protocol/http/Response.java,
* gnu/java/net/protocol/http/ResponseHeaderHandler.java,
* gnu/java/net/protocol/http/SimpleCookieManager.java,
* gnu/java/net/protocol/https/Handler.java,
* gnu/java/net/protocol/jar/Connection.java,
* gnu/java/net/protocol/jar/Handler.java,
* gnu/java/nio/ChannelInputStream.java,
* gnu/java/nio/ChannelOutputStream.java,
* gnu/java/nio/ChannelReader.java,
* gnu/java/nio/ChannelWriter.java,
* gnu/java/nio/DatagramChannelImpl.java,
* gnu/java/nio/DatagramChannelSelectionKey.java,
* gnu/java/nio/EpollSelectionKeyImpl.java,
* gnu/java/nio/EpollSelectorImpl.java,
* gnu/java/nio/FileChannelImpl.java,
* gnu/java/nio/FileLockImpl.java,
* gnu/java/nio/InputStreamChannel.java,
* gnu/java/nio/KqueueSelectionKeyImpl.java,
* gnu/java/nio/KqueueSelectorImpl.java,
* gnu/java/nio/NIODatagramSocket.java,
* gnu/java/nio/NIOServerSocket.java,
* gnu/java/nio/NIOSocket.java,
* gnu/java/nio/NIOSocketImpl.java,
* gnu/java/nio/OutputStreamChannel.java,
* gnu/java/nio/PipeImpl.java,
* gnu/java/nio/SelectionKeyImpl.java,
* gnu/java/nio/SelectorImpl.java,
* gnu/java/nio/SelectorProviderImpl.java,
* gnu/java/nio/ServerSocketChannelImpl.java,
* gnu/java/nio/ServerSocketChannelSelectionKey.java,
* gnu/java/nio/SocketChannelImpl.java,
* gnu/java/nio/SocketChannelSelectionKey.java,
* gnu/java/nio/SocketChannelSelectionKeyImpl.java,
* gnu/java/nio/VMChannelOwner.java,
* gnu/java/nio/charset/ByteCharset.java,
* gnu/java/nio/charset/ByteDecodeLoopHelper.java,
* gnu/java/nio/charset/ByteEncodeLoopHelper.java,
* gnu/java/nio/charset/Cp424.java,
* gnu/java/nio/charset/Cp437.java,
* gnu/java/nio/charset/Cp737.java,
* gnu/java/nio/charset/Cp775.java,
* gnu/java/nio/charset/Cp850.java,
* gnu/java/nio/charset/Cp852.java,
* gnu/java/nio/charset/Cp855.java,
* gnu/java/nio/charset/Cp857.java,
* gnu/java/nio/charset/Cp860.java,
* gnu/java/nio/charset/Cp861.java,
* gnu/java/nio/charset/Cp862.java,
* gnu/java/nio/charset/Cp863.java,
* gnu/java/nio/charset/Cp864.java,
* gnu/java/nio/charset/Cp865.java,
* gnu/java/nio/charset/Cp866.java,
* gnu/java/nio/charset/Cp869.java,
* gnu/java/nio/charset/Cp874.java,
* gnu/java/nio/charset/EncodingHelper.java,
* gnu/java/nio/charset/ISO_8859_1.java,
* gnu/java/nio/charset/ISO_8859_13.java,
* gnu/java/nio/charset/ISO_8859_15.java,
* gnu/java/nio/charset/ISO_8859_2.java,
* gnu/java/nio/charset/ISO_8859_3.java,
* gnu/java/nio/charset/ISO_8859_4.java,
* gnu/java/nio/charset/ISO_8859_5.java,
* gnu/java/nio/charset/ISO_8859_6.java,
* gnu/java/nio/charset/ISO_8859_7.java,
* gnu/java/nio/charset/ISO_8859_8.java,
* gnu/java/nio/charset/ISO_8859_9.java,
* gnu/java/nio/charset/KOI_8.java,
* gnu/java/nio/charset/MS874.java,
* gnu/java/nio/charset/MacCentralEurope.java,
* gnu/java/nio/charset/MacCroatian.java,
* gnu/java/nio/charset/MacCyrillic.java,
* gnu/java/nio/charset/MacDingbat.java,
* gnu/java/nio/charset/MacGreek.java,
* gnu/java/nio/charset/MacIceland.java,
* gnu/java/nio/charset/MacRoman.java,
* gnu/java/nio/charset/MacRomania.java,
* gnu/java/nio/charset/MacSymbol.java,
* gnu/java/nio/charset/MacThai.java,
* gnu/java/nio/charset/MacTurkish.java,
* gnu/java/
Diffstat (limited to 'gnu/java/net/protocol')
37 files changed, 433 insertions, 463 deletions
diff --git a/gnu/java/net/protocol/file/Connection.java b/gnu/java/net/protocol/file/Connection.java index 04278d46a..80155af0d 100644 --- a/gnu/java/net/protocol/file/Connection.java +++ b/gnu/java/net/protocol/file/Connection.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -89,7 +89,7 @@ public class Connection extends URLConnection SystemProperties.getProperty("line.separator"); } - + /** * This is a File object for this connection */ @@ -109,7 +109,7 @@ public class Connection extends URLConnection * OutputStream if we are writing to the file */ private OutputStream outputStream; - + /** * FilePermission to read the file */ @@ -124,7 +124,7 @@ public class Connection extends URLConnection permission = new FilePermission(getURL().getFile(), DEFAULT_PERMISSION); } - + /** * Unquote "%" + hex quotes characters * @@ -146,38 +146,38 @@ public class Connection extends URLConnection int pos = 0; for (int i = 0; i < str.length(); i++) { - char c = str.charAt(i); - if (c == '%') - { - if (i + 2 >= str.length()) - throw new MalformedURLException(str + " : Invalid quoted character"); - int hi = Character.digit(str.charAt(++i), 16); - int lo = Character.digit(str.charAt(++i), 16); - if (lo < 0 || hi < 0) - throw new MalformedURLException(str + " : Invalid quoted character"); - buf[pos++] = (byte) (hi * 16 + lo); - } - else if (c > 127) { - try { - byte [] c_as_bytes = Character.toString(c).getBytes("utf-8"); - final int c_length = c_as_bytes.length; - System.arraycopy(c_as_bytes, 0, buf, pos, c_length); - pos += c_length; - } - catch (java.io.UnsupportedEncodingException x2) { - throw (Error) new InternalError().initCause(x2); - } - } - else - buf[pos++] = (byte) c; + char c = str.charAt(i); + if (c == '%') + { + if (i + 2 >= str.length()) + throw new MalformedURLException(str + " : Invalid quoted character"); + int hi = Character.digit(str.charAt(++i), 16); + int lo = Character.digit(str.charAt(++i), 16); + if (lo < 0 || hi < 0) + throw new MalformedURLException(str + " : Invalid quoted character"); + buf[pos++] = (byte) (hi * 16 + lo); + } + else if (c > 127) { + try { + byte [] c_as_bytes = Character.toString(c).getBytes("utf-8"); + final int c_length = c_as_bytes.length; + System.arraycopy(c_as_bytes, 0, buf, pos, c_length); + pos += c_length; + } + catch (java.io.UnsupportedEncodingException x2) { + throw (Error) new InternalError().initCause(x2); + } + } + else + buf[pos++] = (byte) c; } try { - return new String(buf, 0, pos, "utf-8"); + return new String(buf, 0, pos, "utf-8"); } catch (java.io.UnsupportedEncodingException x2) { - throw (Error) new InternalError().initCause(x2); + throw (Error) new InternalError().initCause(x2); } } @@ -189,30 +189,30 @@ public class Connection extends URLConnection // Call is ignored if already connected. if (connected) return; - + // If not connected, then file needs to be openned. file = new File (unquote(getURL().getFile())); if (! file.isDirectory()) { - if (doInput) - inputStream = new BufferedInputStream(new FileInputStream(file)); - - if (doOutput) - outputStream = new BufferedOutputStream(new FileOutputStream(file)); + if (doInput) + inputStream = new BufferedInputStream(new FileInputStream(file)); + + if (doOutput) + outputStream = new BufferedOutputStream(new FileOutputStream(file)); } else { - if (doInput) - { + if (doInput) + { inputStream = new ByteArrayInputStream(getDirectoryListing()); - } + } - if (doOutput) - throw new ProtocolException - ("file: protocol does not support output on directories"); + if (doOutput) + throw new ProtocolException + ("file: protocol does not support output on directories"); } - + connected = true; } @@ -228,9 +228,9 @@ public class Connection extends URLConnection ByteArrayOutputStream sink = new ByteArrayOutputStream(); // NB uses default character encoding for this system Writer writer = new OutputStreamWriter(sink); - + String[] files = file.list(); - + for (int i = 0; i < files.length; i++) { writer.write(files[i]); @@ -239,9 +239,9 @@ public class Connection extends URLConnection directoryListing = sink.toByteArray(); } - return directoryListing; + return directoryListing; } - + /** * Opens the file for reading and returns a stream for it. * @@ -254,10 +254,10 @@ public class Connection extends URLConnection { if (!doInput) throw new ProtocolException("Can't open InputStream if doInput is false"); - + if (!connected) connect(); - + return inputStream; } @@ -273,11 +273,11 @@ public class Connection extends URLConnection { if (!doOutput) throw new - ProtocolException("Can't open OutputStream if doOutput is false"); + ProtocolException("Can't open OutputStream if doOutput is false"); if (!connected) connect(); - + return outputStream; } @@ -290,30 +290,30 @@ public class Connection extends URLConnection { try { - if (!connected) - connect(); + if (!connected) + connect(); - return file.lastModified(); + return file.lastModified(); } catch (IOException e) { - return -1; + return -1; } } - + /** - * Get an http-style header field. Just handle a few common ones. + * Get an http-style header field. Just handle a few common ones. */ public String getHeaderField(String field) { try { - if (!connected) - connect(); + if (!connected) + connect(); - if (field.equals("content-type")) + if (field.equals("content-type")) return guessContentTypeFromName(file.getName()); - else if (field.equals("content-length")) + else if (field.equals("content-length")) { if (file.isDirectory()) { @@ -321,14 +321,14 @@ public class Connection extends URLConnection } return Long.toString(file.length()); } - else if (field.equals("last-modified")) - { - synchronized (StaticData.dateFormat) - { - return StaticData.dateFormat.format( + else if (field.equals("last-modified")) + { + synchronized (StaticData.dateFormat) + { + return StaticData.dateFormat.format( new Date(file.lastModified())); - } - } + } + } } catch (IOException e) { @@ -346,21 +346,21 @@ public class Connection extends URLConnection { try { - if (!connected) - connect(); - + if (!connected) + connect(); + if (file.isDirectory()) { return getDirectoryListing().length; } - return (int) file.length(); + return (int) file.length(); } catch (IOException e) { - return -1; + return -1; } } - + /** * This method returns a <code>Permission</code> object representing the * permissions required to access this URL. This method returns a diff --git a/gnu/java/net/protocol/file/Handler.java b/gnu/java/net/protocol/file/Handler.java index fc560491d..58ebe4c46 100644 --- a/gnu/java/net/protocol/file/Handler.java +++ b/gnu/java/net/protocol/file/Handler.java @@ -76,14 +76,14 @@ public class Handler extends URLStreamHandler String host = url.getHost(); if ((host != null) && (! host.equals(""))) { - // Reset the protocol (and implicitly the handler) for this URL. - // Then have the URL attempt the connection again, as it will - // get the changed handler the next time around. - // If the ftp protocol handler is not installed, an - // exception will be thrown from the new openConnection() call. - setURL (url, "ftp", url.getHost(), url.getPort(), url.getFile(), - url.getRef()); - return url.openConnection(); + // Reset the protocol (and implicitly the handler) for this URL. + // Then have the URL attempt the connection again, as it will + // get the changed handler the next time around. + // If the ftp protocol handler is not installed, an + // exception will be thrown from the new openConnection() call. + setURL (url, "ftp", url.getHost(), url.getPort(), url.getFile(), + url.getRef()); + return url.openConnection(); } return new Connection(url); diff --git a/gnu/java/net/protocol/ftp/ActiveModeDTP.java b/gnu/java/net/protocol/ftp/ActiveModeDTP.java index aa3c412b6..1ed31b830 100644 --- a/gnu/java/net/protocol/ftp/ActiveModeDTP.java +++ b/gnu/java/net/protocol/ftp/ActiveModeDTP.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -128,7 +128,7 @@ final class ActiveModeDTP } acceptThread = null; } - + /** * Returns an input stream from which a remote file can be read. */ @@ -213,7 +213,7 @@ final class ActiveModeDTP transferComplete(); return inProgress; } - + public void transferComplete() { if (socket == null) @@ -247,6 +247,5 @@ final class ActiveModeDTP } } } - -} +} diff --git a/gnu/java/net/protocol/ftp/BlockInputStream.java b/gnu/java/net/protocol/ftp/BlockInputStream.java index 63897f1d6..09915e7ff 100644 --- a/gnu/java/net/protocol/ftp/BlockInputStream.java +++ b/gnu/java/net/protocol/ftp/BlockInputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -147,4 +147,3 @@ class BlockInputStream } } - diff --git a/gnu/java/net/protocol/ftp/BlockOutputStream.java b/gnu/java/net/protocol/ftp/BlockOutputStream.java index 85481c95b..d181f9dec 100644 --- a/gnu/java/net/protocol/ftp/BlockOutputStream.java +++ b/gnu/java/net/protocol/ftp/BlockOutputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -108,4 +108,3 @@ class BlockOutputStream } } - diff --git a/gnu/java/net/protocol/ftp/CompressedInputStream.java b/gnu/java/net/protocol/ftp/CompressedInputStream.java index f2e65b7d3..638d780e6 100644 --- a/gnu/java/net/protocol/ftp/CompressedInputStream.java +++ b/gnu/java/net/protocol/ftp/CompressedInputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -133,13 +133,13 @@ class CompressedInputStream n--; return c; } - + public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); } - + public int read(byte[] buf, int off, int len) throws IOException { @@ -186,7 +186,7 @@ class CompressedInputStream return l; */ } - + /** * Reads the block header. */ @@ -212,4 +212,3 @@ class CompressedInputStream } } - diff --git a/gnu/java/net/protocol/ftp/CompressedOutputStream.java b/gnu/java/net/protocol/ftp/CompressedOutputStream.java index b960fb3af..ec3aef930 100644 --- a/gnu/java/net/protocol/ftp/CompressedOutputStream.java +++ b/gnu/java/net/protocol/ftp/CompressedOutputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -57,7 +57,7 @@ class CompressedOutputStream { super(dtp, out); } - + /** * Just one byte cannot be compressed. * It takes 5 bytes to transmit - hardly very compressed! @@ -190,7 +190,7 @@ class CompressedOutputStream System.arraycopy(buf, 0, ret, 3, pos); return ret; } - + int flush_compressed(byte[] buf, int pos, int count, byte c) { buf[pos++] = (byte) (0x80 | count); @@ -225,4 +225,3 @@ class CompressedOutputStream } } - diff --git a/gnu/java/net/protocol/ftp/DTP.java b/gnu/java/net/protocol/ftp/DTP.java index 25580af40..9ba4b7c6c 100644 --- a/gnu/java/net/protocol/ftp/DTP.java +++ b/gnu/java/net/protocol/ftp/DTP.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -89,4 +89,3 @@ interface DTP void transferComplete(); } - diff --git a/gnu/java/net/protocol/ftp/DTPInputStream.java b/gnu/java/net/protocol/ftp/DTPInputStream.java index 363a5590f..7280b0133 100644 --- a/gnu/java/net/protocol/ftp/DTPInputStream.java +++ b/gnu/java/net/protocol/ftp/DTPInputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -74,7 +74,7 @@ abstract class DTPInputStream { transferComplete = flag; } - + /** * Notifies the controlling DTP that this stream has completed transfer. */ @@ -85,4 +85,3 @@ abstract class DTPInputStream } } - diff --git a/gnu/java/net/protocol/ftp/DTPOutputStream.java b/gnu/java/net/protocol/ftp/DTPOutputStream.java index 83f0be1e3..105c6f095 100644 --- a/gnu/java/net/protocol/ftp/DTPOutputStream.java +++ b/gnu/java/net/protocol/ftp/DTPOutputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 diff --git a/gnu/java/net/protocol/ftp/FTPConnection.java b/gnu/java/net/protocol/ftp/FTPConnection.java index 98e8a868d..4e253fcb9 100644 --- a/gnu/java/net/protocol/ftp/FTPConnection.java +++ b/gnu/java/net/protocol/ftp/FTPConnection.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -125,7 +125,7 @@ public class FTPConnection protected static final String STAT = "STAT"; protected static final String HELP = "HELP"; protected static final String NOOP = "NOOP"; - + protected static final String AUTH = "AUTH"; protected static final String PBSZ = "PBSZ"; protected static final String PROT = "PROT"; @@ -211,7 +211,7 @@ public class FTPConnection { this(hostname, -1, 0, 0, false); } - + /** * Creates a new connection to the server. * @param hostname the hostname of the server to connect to @@ -242,7 +242,7 @@ public class FTPConnection { port = FTP_PORT; } - + // Set up socket socket = new Socket(); InetSocketAddress address = new InetSocketAddress(hostname, port); @@ -258,7 +258,7 @@ public class FTPConnection { socket.setSoTimeout(timeout); } - + InputStream in = socket.getInputStream(); in = new BufferedInputStream(in); in = new CRLFInputStream(in); @@ -266,7 +266,7 @@ public class FTPConnection OutputStream out = socket.getOutputStream(); out = new BufferedOutputStream(out); this.out = new CRLFOutputStream(out); - + // Read greeting FTPResponse response = getResponse(); switch (response.getCode()) @@ -277,7 +277,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Authenticate using the specified username and password. * If the username suffices for the server, the password will not be used @@ -331,7 +331,7 @@ public class FTPConnection { return starttls(confidential, new EmptyX509TrustManager()); } - + /** * Negotiates TLS over the current connection. * See IETF draft-murray-auth-ftp-ssl-15.txt for details. @@ -351,7 +351,7 @@ public class FTPConnection TrustManager[] trust = new TrustManager[] { tm }; context.init(null, trust, null); SSLSocketFactory factory = context.getSocketFactory(); - + send(AUTH + ' ' + TLS); FTPResponse response = getResponse(); switch (response.getCode()) @@ -367,7 +367,7 @@ public class FTPConnection default: throw new FTPException(response); } - + String hostname = socket.getInetAddress().getHostName(); int port = socket.getPort(); SSLSocket ss = @@ -403,7 +403,7 @@ public class FTPConnection default: throw new FTPException(response); } - + if (confidential) { // Set up streams @@ -422,7 +422,7 @@ public class FTPConnection return false; } } - + /** * Changes directory to the specified path. * @param path an absolute or relative pathname @@ -447,7 +447,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Changes directory to the parent of the current working directory. * @return true on success, false otherwise @@ -521,7 +521,7 @@ public class FTPConnection { } } - + /** * Initialise the data transfer process. */ @@ -533,7 +533,7 @@ public class FTPConnection dtp.complete(); dtp = null; } - + InetAddress localhost = socket.getLocalAddress(); if (passive) { @@ -568,7 +568,7 @@ public class FTPConnection { c = message.charAt((++end) + 1); } - + String address = message.substring(start, mid1).replace(',', '.'); int port_hi = @@ -576,7 +576,7 @@ public class FTPConnection int port_lo = Integer.parseInt(message.substring(mid2 + 1, end + 1)); int port = (port_hi << 8) | port_lo; - + /*System.out.println("Entering passive mode: " + address + ":" + port);*/ dtp = new PassiveModeDTP(address, port, localhost, @@ -621,7 +621,7 @@ public class FTPConnection } } } - + // Send PORT command CPStringBuilder buf = new CPStringBuilder(PORT); buf.append(' '); @@ -657,7 +657,7 @@ public class FTPConnection } dtp.setTransferMode(transferMode); } - + /** * Set passive mode. * @param flag true if we should use passive mode, false otherwise @@ -671,7 +671,7 @@ public class FTPConnection initialiseDTP(); } } - + /** * Returns the current representation type of the transfer data. * @return TYPE_ASCII, TYPE_EBCDIC, or TYPE_BINARY @@ -809,7 +809,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Retrieves the specified file. * @param filename the filename of the file to retrieve @@ -849,7 +849,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Returns a stream for uploading a file. * If a file with the same filename already exists on the server, it will @@ -903,7 +903,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * This command may be required by some servers to reserve sufficient * storage to accommodate the new file to be transferred. @@ -926,7 +926,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Renames a file. * @param oldName the current name of the file @@ -963,7 +963,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Aborts the transfer in progress. * @return true if a transfer was in progress, false otherwise @@ -993,7 +993,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Causes the file specified to be deleted at the server site. * @param filename the file to delete @@ -1015,7 +1015,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Causes the directory specified to be deleted. * This may be an absolute or relative pathname. @@ -1059,7 +1059,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Returns the current working directory. */ @@ -1097,7 +1097,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Returns a listing of information about the specified pathname. * If the pathname specifies a directory or other group of files, the @@ -1133,7 +1133,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Returns a directory listing. The pathname should specify a * directory or other system-specific file group descriptor; a null @@ -1179,7 +1179,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Returns the type of operating system at the server. */ @@ -1205,7 +1205,7 @@ public class FTPConnection throw new FTPException(response); } } - + /** * Does nothing. * This method can be used to ensure that the connection does not time @@ -1316,7 +1316,7 @@ public class FTPConnection throw new ProtocolException(line); } } - + /* * Parses the 3-digit numeric code at the beginning of the given line. * Returns -1 on failure. @@ -1350,4 +1350,3 @@ public class FTPConnection } } - diff --git a/gnu/java/net/protocol/ftp/FTPException.java b/gnu/java/net/protocol/ftp/FTPException.java index 14ad3813f..1a7fcb85d 100644 --- a/gnu/java/net/protocol/ftp/FTPException.java +++ b/gnu/java/net/protocol/ftp/FTPException.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -63,7 +63,7 @@ public class FTPException super(response.getMessage()); this.response = response; } - + /** * Returns the response that provoked this exception. */ @@ -73,4 +73,3 @@ public class FTPException } } - diff --git a/gnu/java/net/protocol/ftp/FTPResponse.java b/gnu/java/net/protocol/ftp/FTPResponse.java index ec72c732c..2620f0d70 100644 --- a/gnu/java/net/protocol/ftp/FTPResponse.java +++ b/gnu/java/net/protocol/ftp/FTPResponse.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -109,4 +109,3 @@ public final class FTPResponse } } - diff --git a/gnu/java/net/protocol/ftp/FTPURLConnection.java b/gnu/java/net/protocol/ftp/FTPURLConnection.java index cfad5a7c1..8cc1fafd1 100644 --- a/gnu/java/net/protocol/ftp/FTPURLConnection.java +++ b/gnu/java/net/protocol/ftp/FTPURLConnection.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -137,7 +137,7 @@ public class FTPURLConnection connection.setTransferMode(transferMode); } } - + /** * This connection supports doInput. */ @@ -153,7 +153,7 @@ public class FTPURLConnection { doOutput = dooutput; } - + /** * Returns an input stream that reads from this open connection. */ @@ -174,7 +174,7 @@ public class FTPURLConnection return this.new ClosingInputStream(connection.retrieve(path)); } } - + /** * Returns an output stream that writes to this connection. */ @@ -252,7 +252,7 @@ public class FTPURLConnection l.add(value); map.put(key, l); } - + public void setRequestProperty(String key, String value) { if (connected) @@ -351,7 +351,7 @@ public class FTPURLConnection super.close(); connection.logout(); } - + } class ClosingOutputStream @@ -369,8 +369,7 @@ public class FTPURLConnection super.close(); connection.logout(); } - + } } - diff --git a/gnu/java/net/protocol/ftp/Handler.java b/gnu/java/net/protocol/ftp/Handler.java index 88491b3c1..7638b6664 100644 --- a/gnu/java/net/protocol/ftp/Handler.java +++ b/gnu/java/net/protocol/ftp/Handler.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -67,4 +67,3 @@ public class Handler } } - diff --git a/gnu/java/net/protocol/ftp/PassiveModeDTP.java b/gnu/java/net/protocol/ftp/PassiveModeDTP.java index 6f4fd6341..a74346c74 100644 --- a/gnu/java/net/protocol/ftp/PassiveModeDTP.java +++ b/gnu/java/net/protocol/ftp/PassiveModeDTP.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -118,7 +118,7 @@ final class PassiveModeDTP in.setTransferComplete(false); return in; } - + /** * Returns an output stream to which a local file can be written for * upload. @@ -147,12 +147,12 @@ final class PassiveModeDTP out.setTransferComplete(false); return out; } - + public void setTransferMode(int mode) { transferMode = mode; } - + public void complete() { completed = true; @@ -198,4 +198,3 @@ final class PassiveModeDTP } } - diff --git a/gnu/java/net/protocol/ftp/StreamInputStream.java b/gnu/java/net/protocol/ftp/StreamInputStream.java index 93eee4e19..beee14bcb 100644 --- a/gnu/java/net/protocol/ftp/StreamInputStream.java +++ b/gnu/java/net/protocol/ftp/StreamInputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -54,7 +54,7 @@ class StreamInputStream { super(dtp, in); } - + public int read() throws IOException { @@ -92,4 +92,3 @@ class StreamInputStream } } - diff --git a/gnu/java/net/protocol/ftp/StreamOutputStream.java b/gnu/java/net/protocol/ftp/StreamOutputStream.java index a6e28ece3..2df1a87d8 100644 --- a/gnu/java/net/protocol/ftp/StreamOutputStream.java +++ b/gnu/java/net/protocol/ftp/StreamOutputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -54,7 +54,7 @@ class StreamOutputStream { super(dtp, out); } - + public void write(int c) throws IOException { @@ -70,7 +70,7 @@ class StreamOutputStream { write(b, 0, b.length); } - + public void write(byte[] b, int off, int len) throws IOException { @@ -80,6 +80,5 @@ class StreamOutputStream } out.write(b, off, len); } - -} +} diff --git a/gnu/java/net/protocol/http/Authenticator.java b/gnu/java/net/protocol/http/Authenticator.java index 0d7c98819..b4ee41e11 100644 --- a/gnu/java/net/protocol/http/Authenticator.java +++ b/gnu/java/net/protocol/http/Authenticator.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -54,6 +54,5 @@ public interface Authenticator * unsuccessful attempt */ Credentials getCredentials(String realm, int attempt); - -} +} diff --git a/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java b/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java index 35ad2bccf..22a33ccd3 100644 --- a/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java +++ b/gnu/java/net/protocol/http/ByteArrayRequestBodyWriter.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -102,6 +102,5 @@ public class ByteArrayRequestBodyWriter } return len; } - -} +} diff --git a/gnu/java/net/protocol/http/ChunkedInputStream.java b/gnu/java/net/protocol/http/ChunkedInputStream.java index 8a30e51db..33df0df95 100644 --- a/gnu/java/net/protocol/http/ChunkedInputStream.java +++ b/gnu/java/net/protocol/http/ChunkedInputStream.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -158,15 +158,15 @@ public class ChunkedInputStream } else { - int canRead = Math.min(size - count, length); - int len = in.read(buffer, offset, canRead); - if (len == -1) - { - // This is an error condition but it isn't clear what we - // should do with it. - eof = true; - return -1; - } + int canRead = Math.min(size - count, length); + int len = in.read(buffer, offset, canRead); + if (len == -1) + { + // This is an error condition but it isn't clear what we + // should do with it. + eof = true; + return -1; + } count += len; if (count == size) { @@ -205,20 +205,19 @@ public class ChunkedInputStream { if (meta) return 0; - + return Math.min(in.available(), size - count); } /** * This method closes the ChunkedInputStream by closing the underlying * InputStream. - * + * * @exception IOException If an error occurs */ public void close() throws IOException { in.close(); } - -} +} diff --git a/gnu/java/net/protocol/http/Cookie.java b/gnu/java/net/protocol/http/Cookie.java index 4482a121e..122a23f79 100644 --- a/gnu/java/net/protocol/http/Cookie.java +++ b/gnu/java/net/protocol/http/Cookie.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -138,7 +138,7 @@ public class Cookie { return toString(true, true); } - + public String toString(boolean showPath, boolean showDomain) { CPStringBuilder buf = new CPStringBuilder(); @@ -159,4 +159,3 @@ public class Cookie } } - diff --git a/gnu/java/net/protocol/http/CookieManager.java b/gnu/java/net/protocol/http/CookieManager.java index cc1225c49..da3686689 100644 --- a/gnu/java/net/protocol/http/CookieManager.java +++ b/gnu/java/net/protocol/http/CookieManager.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -61,5 +61,5 @@ public interface CookieManager * @param path the path to access */ Cookie[] getCookies(String host, boolean secure, String path); - + } diff --git a/gnu/java/net/protocol/http/Credentials.java b/gnu/java/net/protocol/http/Credentials.java index 9e5fcd172..f95b4b53c 100644 --- a/gnu/java/net/protocol/http/Credentials.java +++ b/gnu/java/net/protocol/http/Credentials.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -83,6 +83,5 @@ public class Credentials { return password; } - -} +} diff --git a/gnu/java/net/protocol/http/HTTPConnection.java b/gnu/java/net/protocol/http/HTTPConnection.java index 44b1a608a..b96bf4c54 100644 --- a/gnu/java/net/protocol/http/HTTPConnection.java +++ b/gnu/java/net/protocol/http/HTTPConnection.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -201,7 +201,7 @@ public class HTTPConnection this(hostname, secure ? HTTPS_PORT : HTTP_PORT, secure, connectionTimeout, timeout); } - + /** * Creates a new HTTP connection on the specified port. * @param hostname the name of the host to connect to @@ -222,7 +222,7 @@ public class HTTPConnection { this(hostname, port, secure, 0, 0); } - + /** * Creates a new HTTP or HTTPS connection on the specified port. * @param hostname the name of the host to connect to @@ -239,7 +239,7 @@ public class HTTPConnection { if (connectionTimeout < 0 || timeout < 0) throw new IllegalArgumentException(); - + this.hostname = hostname; this.port = port; this.secure = secure; @@ -477,8 +477,8 @@ public class HTTPConnection */ synchronized HTTPConnection get(String host, int port, - boolean secure, - int connectionTimeout, int timeout) + boolean secure, + int connectionTimeout, int timeout) { String ttl = SystemProperties.getProperty("classpath.net.http.keepAliveTTL"); @@ -510,7 +510,7 @@ public class HTTPConnection } HTTPConnection c = null; - + ListIterator it = connectionPool.listIterator(0); while (it.hasNext()) { @@ -584,7 +584,7 @@ public class HTTPConnection } } } - + /** * The number of times this HTTPConnection has be used via keep-alive. */ @@ -618,7 +618,7 @@ public class HTTPConnection { useCount++; pool.put(this); - + } else { @@ -878,7 +878,7 @@ public class HTTPConnection } // -- Events -- - + void addHandshakeCompletedListener(HandshakeCompletedListener l) { synchronized (handshakeCompletedListeners) @@ -895,4 +895,3 @@ public class HTTPConnection } } - diff --git a/gnu/java/net/protocol/http/HTTPDateFormat.java b/gnu/java/net/protocol/http/HTTPDateFormat.java index 2f59e4318..743f8e8e2 100644 --- a/gnu/java/net/protocol/http/HTTPDateFormat.java +++ b/gnu/java/net/protocol/http/HTTPDateFormat.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -145,7 +145,7 @@ public class HTTPDateFormat // Get time offset in minutes int zoneOffset =(calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET)) / 60000; - + // Apply + or - appropriately if (zoneOffset < 0) { @@ -156,7 +156,7 @@ public class HTTPDateFormat { buf.append('+'); } - + // Set the 2 2-char fields as specified above int tzhours = zoneOffset / 60; buf.append(Character.forDigit(tzhours / 10, 10)); @@ -340,14 +340,14 @@ public class HTTPDateFormat } second = Integer.parseInt(text.substring(start, end)); } - + calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month); calendar.set(Calendar.DAY_OF_MONTH, date); calendar.set(Calendar.HOUR, hour); calendar.set(Calendar.MINUTE, minute); calendar.set(Calendar.SECOND, second); - + if (end != len) { // Timezone @@ -380,7 +380,7 @@ public class HTTPDateFormat } } pos.setIndex(end); - + return calendar.getTime(); } catch (NumberFormatException e) @@ -400,7 +400,7 @@ public class HTTPDateFormat { pos++; } - return pos; + return pos; } private int skipNonWhitespace(String text, int pos) @@ -409,7 +409,7 @@ public class HTTPDateFormat { pos++; } - return pos; + return pos; } private int skipTo(String text, int pos, char c) @@ -418,7 +418,7 @@ public class HTTPDateFormat { pos++; } - return pos; + return pos; } /** @@ -438,4 +438,3 @@ public class HTTPDateFormat } } - diff --git a/gnu/java/net/protocol/http/HTTPURLConnection.java b/gnu/java/net/protocol/http/HTTPURLConnection.java index b31f42669..9ba5c4793 100644 --- a/gnu/java/net/protocol/http/HTTPURLConnection.java +++ b/gnu/java/net/protocol/http/HTTPURLConnection.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -151,7 +151,7 @@ public class HTTPURLConnection } final Credentials creds = (username == null) ? null : new Credentials (username, password); - + if ("POST".equals(method)) { String contentType = requestHeaders.getValue("Content-Type"); @@ -241,113 +241,113 @@ public class HTTPURLConnection throw ioe; } } - + if (response.isRedirect() && getInstanceFollowRedirects()) { - // Read the response body, if there is one. If the - // redirect points us back at the same server, we will use - // the cached connection, so we must make sure there is no - // pending data in it. + // Read the response body, if there is one. If the + // redirect points us back at the same server, we will use + // the cached connection, so we must make sure there is no + // pending data in it. InputStream body = response.getBody(); - if (body != null) - { - byte[] ignore = new byte[1024]; - while (true) - { - int n = body.read(ignore, 0, ignore.length); - if (n == -1) - break; - } - } + if (body != null) + { + byte[] ignore = new byte[1024]; + while (true) + { + int n = body.read(ignore, 0, ignore.length); + if (n == -1) + break; + } + } // Follow redirect String location = response.getHeader("Location"); - if (location != null) - { - String connectionUri = connection.getURI(); - int start = connectionUri.length(); - if (location.startsWith(connectionUri) && - location.charAt(start) == '/') - { - file = location.substring(start); - retry = true; - } - else if (location.startsWith("http:")) - { - connection.close(); - connection = null; - secure = false; - start = 7; - int end = location.indexOf('/', start); + if (location != null) + { + String connectionUri = connection.getURI(); + int start = connectionUri.length(); + if (location.startsWith(connectionUri) && + location.charAt(start) == '/') + { + file = location.substring(start); + retry = true; + } + else if (location.startsWith("http:")) + { + connection.close(); + connection = null; + secure = false; + start = 7; + int end = location.indexOf('/', start); if (end == -1) end = location.length(); - host = location.substring(start, end); - int ci = host.lastIndexOf(':'); - if (ci != -1) - { - port = Integer.parseInt(host.substring (ci + 1)); - host = host.substring(0, ci); - } - else - { - port = HTTPConnection.HTTP_PORT; - } - file = location.substring(end); - retry = true; - } - else if (location.startsWith("https:")) - { - connection.close(); - connection = null; - secure = true; - start = 8; - int end = location.indexOf('/', start); + host = location.substring(start, end); + int ci = host.lastIndexOf(':'); + if (ci != -1) + { + port = Integer.parseInt(host.substring (ci + 1)); + host = host.substring(0, ci); + } + else + { + port = HTTPConnection.HTTP_PORT; + } + file = location.substring(end); + retry = true; + } + else if (location.startsWith("https:")) + { + connection.close(); + connection = null; + secure = true; + start = 8; + int end = location.indexOf('/', start); if (end == -1) end = location.length(); - host = location.substring(start, end); - int ci = host.lastIndexOf(':'); - if (ci != -1) - { - port = Integer.parseInt(host.substring (ci + 1)); - host = host.substring(0, ci); - } - else - { - port = HTTPConnection.HTTPS_PORT; - } - file = location.substring(end); - retry = true; - } - else if (location.length() > 0) - { - // Malformed absolute URI, treat as file part of URI - if (location.charAt(0) == '/') - { - // Absolute path - file = location; - } - else - { - // Relative path - int lsi = file.lastIndexOf('/'); - file = (lsi == -1) ? "/" : file.substring(0, lsi + 1); - file += location; - } - retry = true; - } - } + host = location.substring(start, end); + int ci = host.lastIndexOf(':'); + if (ci != -1) + { + port = Integer.parseInt(host.substring (ci + 1)); + host = host.substring(0, ci); + } + else + { + port = HTTPConnection.HTTPS_PORT; + } + file = location.substring(end); + retry = true; + } + else if (location.length() > 0) + { + // Malformed absolute URI, treat as file part of URI + if (location.charAt(0) == '/') + { + // Absolute path + file = location; + } + else + { + // Relative path + int lsi = file.lastIndexOf('/'); + file = (lsi == -1) ? "/" : file.substring(0, lsi + 1); + file += location; + } + retry = true; + } + } } else { responseSink = response.getBody(); - + if (response.isError()) - errorSink = responseSink; + errorSink = responseSink; } } while (retry); connected = true; - } + } /** * Returns a connection, from the pool if necessary. @@ -425,7 +425,7 @@ public class HTTPURLConnection } public String getRequestProperty(String key) - { + { return requestHeaders.getValue(key); } @@ -433,7 +433,7 @@ public class HTTPURLConnection { if (connected) throw new IllegalStateException("Already connected"); - + Map<String, List<String>> m = requestHeaders.getAsMap(); return Collections.unmodifiableMap(m); } @@ -441,7 +441,7 @@ public class HTTPURLConnection public void setRequestProperty(String key, String value) { super.setRequestProperty(key, value); - + requestHeaders.put(key, value); } @@ -477,9 +477,9 @@ public class HTTPURLConnection } return requestSink; } - + // -- Response -- - + public InputStream getInputStream() throws IOException { @@ -491,17 +491,17 @@ public class HTTPURLConnection { throw new ProtocolException("doInput is false"); } - + if (response.isError()) { int code = response.getCode(); if (code == 404 || code == 410) throw new FileNotFoundException(url.toString()); - + throw new IOException("Server returned HTTP response code " + code + " for URL " + url.toString()); } - + return responseSink; } @@ -535,7 +535,7 @@ public class HTTPURLConnection " " + response.getCode() + " " + response.getMessage(); } - + public String getHeaderField(int index) { if (!connected) @@ -641,7 +641,7 @@ public class HTTPURLConnection } return handshakeEvent.getCipherSuite(); } - + public Certificate[] getLocalCertificates() { if (!connected) @@ -681,14 +681,13 @@ public class HTTPURLConnection super.setReadTimeout(timeout); if (connection == null) return; - try + try { - connection.getSocket().setSoTimeout(timeout); - } + connection.getSocket().setSoTimeout(timeout); + } catch (IOException se) { - // Ignore socket exceptions. + // Ignore socket exceptions. } } } - diff --git a/gnu/java/net/protocol/http/Handler.java b/gnu/java/net/protocol/http/Handler.java index 640542513..30810321d 100644 --- a/gnu/java/net/protocol/http/Handler.java +++ b/gnu/java/net/protocol/http/Handler.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -70,4 +70,3 @@ public class Handler } } - diff --git a/gnu/java/net/protocol/http/Headers.java b/gnu/java/net/protocol/http/Headers.java index 690a0c65b..faf5eb195 100644 --- a/gnu/java/net/protocol/http/Headers.java +++ b/gnu/java/net/protocol/http/Headers.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -71,7 +71,7 @@ class Headers implements Iterable<Headers.HeaderElement> */ private final ArrayList<HeaderElement> headers = new ArrayList<HeaderElement>(); - + /** * The HTTP dateformat used to parse date header fields. */ @@ -111,11 +111,11 @@ class Headers implements Iterable<Headers.HeaderElement> { return headers.iterator(); } - + /** * Returns the value of the specified header as a string. If * multiple values are present, the last one is returned. - * + * * @param header the header name (case insensitive search) * @return The header value or <code>null</code> if not found. */ @@ -135,7 +135,7 @@ class Headers implements Iterable<Headers.HeaderElement> /** * Returns the value of the specified header as an integer. If * multiple values are present, the last one is returned. - * + * * @param header the header name (case insensitive search) * @return The header value or <code>-1</code> if not present or * not an integer value. @@ -161,7 +161,7 @@ class Headers implements Iterable<Headers.HeaderElement> /** * Returns the value of the specified header as a long. If * multiple values are present, the last one is returned. - * + * * @param header the header name (case insensitive search) * @return The header value or <code>-1</code> if not present or * not a long value. @@ -187,7 +187,7 @@ class Headers implements Iterable<Headers.HeaderElement> /** * Returns the value of the specified header as a date. If * multiple values are present, the last one is returned. - * + * * @param header the header name (case insensitive search) * @return The header value or <code>null</code> if not present or * not a date value. @@ -212,7 +212,7 @@ class Headers implements Iterable<Headers.HeaderElement> /** * Add a header to this set of headers. If there is an existing * header with the same name it's value is replaced with the new value. - * If multiple headers of the same name exist only the last one's value + * If multiple headers of the same name exist only the last one's value * is replaced. * * @param name the header name @@ -221,7 +221,7 @@ class Headers implements Iterable<Headers.HeaderElement> * @see #addValue(String, String) */ public void put(String name, String value) - { + { for (int i = headers.size() - 1; i >= 0; i--) { HeaderElement e = headers.get(i); @@ -231,14 +231,14 @@ class Headers implements Iterable<Headers.HeaderElement> return; } } - + // nothing was replaced so add it as new HeaderElement addValue(name, value); } - + /** - * Add all headers from a set of headers to this set. Any existing header - * with the same (case insensitive) name as one of the new headers will + * Add all headers from a set of headers to this set. Any existing header + * with the same (case insensitive) name as one of the new headers will * be overridden. * * @param o the headers to be added @@ -280,7 +280,7 @@ class Headers implements Iterable<Headers.HeaderElement> { LineInputStream lin = (in instanceof LineInputStream) ? (LineInputStream) in : new LineInputStream(in); - + String name = null; CPStringBuilder value = new CPStringBuilder(); while (true) @@ -307,9 +307,9 @@ class Headers implements Iterable<Headers.HeaderElement> if (c1 == ' ' || c1 == '\t') { // Continuation - int last = len - 1; - if (line.charAt(last) != '\r') - ++last; + int last = len - 1; + if (line.charAt(last) != '\r') + ++last; value.append(line.substring(0, last)); } else @@ -318,7 +318,7 @@ class Headers implements Iterable<Headers.HeaderElement> { addValue(name, value.toString()); } - + int di = line.indexOf(':'); name = line.substring(0, di); value.setLength(0); @@ -327,14 +327,14 @@ class Headers implements Iterable<Headers.HeaderElement> di++; } while (di < len && line.charAt(di) == ' '); - int last = len - 1; - if (line.charAt(last) != '\r') - ++last; + int last = len - 1; + if (line.charAt(last) != '\r') + ++last; value.append(line.substring(di, last)); } } } - + /** * Add a header to this set of headers. If there is an existing @@ -352,12 +352,12 @@ class Headers implements Iterable<Headers.HeaderElement> /** * Get a new Map containing all the headers. The keys of the Map - * are Strings (the header names). The headers will be included + * are Strings (the header names). The headers will be included * case-sensitive in the map so that querying must be done with the * correct case of the needed header name. The values of the Map are * unmodifiable Lists containing Strings (the header values). * - * <p> + * <p> * The returned map is modifiable. Changing it will not effect this * collection of Headers in any way.</p> * @@ -387,7 +387,7 @@ class Headers implements Iterable<Headers.HeaderElement> } return m; } - + /** * Get the name of the Nth header. * @@ -401,7 +401,7 @@ class Headers implements Iterable<Headers.HeaderElement> { if (i >= headers.size() || i < 0) return null; - + return headers.get(i).name; } @@ -418,7 +418,7 @@ class Headers implements Iterable<Headers.HeaderElement> { if (i >= headers.size() || i < 0) return null; - + return headers.get(i).value; } } diff --git a/gnu/java/net/protocol/http/Request.java b/gnu/java/net/protocol/http/Request.java index 88e2fd077..534213eed 100644 --- a/gnu/java/net/protocol/http/Request.java +++ b/gnu/java/net/protocol/http/Request.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -280,14 +280,14 @@ public class Request setHeader("Content-Length", Integer.toString(contentLength)); } } - + try { // Loop while authentication fails or continue do { retry = false; - + // Get socket output and input streams OutputStream out = connection.getOutputStream(); @@ -314,7 +314,7 @@ public class Request byte[] buffer = new byte[4096]; int len; int count = 0; - + requestBodyWriter.reset(); do { @@ -372,13 +372,13 @@ public class Request } return response; } - + Response readResponse(InputStream in) throws IOException { String line; int len; - + // Read response status line LineInputStream lis = new LineInputStream(in); @@ -414,7 +414,7 @@ public class Request responseHeaders.parse(lis); notifyHeaderHandlers(responseHeaders); InputStream body = null; - + switch (code) { case 100: @@ -459,7 +459,7 @@ public class Request throws IOException { long contentLength = -1; - + // Persistent connections are the default in HTTP/1.1 boolean doClose = "close".equalsIgnoreCase(getHeader("Connection")) || "close".equalsIgnoreCase(responseHeaders.getValue("Connection")) || @@ -475,9 +475,9 @@ public class Request else if ("chunked".equalsIgnoreCase(transferCoding)) { in = new LimitedLengthInputStream(in, -1, false, connection, doClose); - + in = new ChunkedInputStream(in, responseHeaders); - } + } else { contentLength = responseHeaders.getLongValue("Content-Length"); @@ -505,9 +505,9 @@ public class Request throw new ProtocolException("Unsupported Content-Encoding: " + contentCoding); } - // Remove the Content-Encoding header because the content is - // no longer compressed. - responseHeaders.remove("Content-Encoding"); + // Remove the Content-Encoding header because the content is + // no longer compressed. + responseHeaders.remove("Content-Encoding"); } return in; } @@ -551,7 +551,7 @@ public class Request { MessageDigest md5 = MessageDigest.getInstance("MD5"); final byte[] COLON = { 0x3a }; - + // Calculate H(A1) md5.reset(); md5.update(username.getBytes("US-ASCII")); @@ -572,7 +572,7 @@ public class Request ha1 = md5.digest(); } String ha1Hex = toHexString(ha1); - + // Calculate H(A2) md5.reset(); md5.update(method.getBytes("US-ASCII")); @@ -586,7 +586,7 @@ public class Request } byte[] ha2 = md5.digest(); String ha2Hex = toHexString(ha2); - + // Calculate response md5.reset(); md5.update(ha1Hex.getBytes("US-ASCII")); @@ -606,8 +606,8 @@ public class Request md5.update(COLON); md5.update(ha2Hex.getBytes("US-ASCII")); String digestResponse = toHexString(md5.digest()); - - String authorization = scheme + + + String authorization = scheme + " username=\"" + username + "\"" + " realm=\"" + realm + "\"" + " nonce=\"" + nonce + "\"" + @@ -652,7 +652,7 @@ public class Request buf.setLength(0); } else if (c != ',' || (i <(len - 1) && text.charAt(i + 1) != ' ')) - { + { buf.append(c); } } @@ -855,4 +855,3 @@ public class Request } } - diff --git a/gnu/java/net/protocol/http/RequestBodyWriter.java b/gnu/java/net/protocol/http/RequestBodyWriter.java index 05d98ebb8..aa5b78a54 100644 --- a/gnu/java/net/protocol/http/RequestBodyWriter.java +++ b/gnu/java/net/protocol/http/RequestBodyWriter.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -64,6 +64,5 @@ public interface RequestBodyWriter * @return the number of bytes written */ int write(byte[] buffer); - -} +} diff --git a/gnu/java/net/protocol/http/Response.java b/gnu/java/net/protocol/http/Response.java index 76fac9344..084cf75fa 100644 --- a/gnu/java/net/protocol/http/Response.java +++ b/gnu/java/net/protocol/http/Response.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -61,7 +61,7 @@ public class Response /** * The HTTP status code of the response. - */ + */ protected final int code; /** @@ -114,7 +114,7 @@ public class Response /** * Returns the HTTP status code of the response. * @see #code - */ + */ public int getCode() { return code; @@ -188,22 +188,22 @@ public class Response { return headers.getDateValue(name); } - + /** * Tests whether this response indicates a redirection. - * + * * @return <code>true</code> if, <code>false</code> otherwise. */ public boolean isRedirect() { return (code != 304 && getCodeClass() == 3); } - + /** * Tests whether this response indicates an error. * Errors are the response codes <code>4xx</code> - Client error and * <code>5xx</code> - Server error. - * + * * @return <code>true</code> if, <code>false</code> otherwise. */ public boolean isError() @@ -221,4 +221,3 @@ public class Response return body; } } - diff --git a/gnu/java/net/protocol/http/ResponseHeaderHandler.java b/gnu/java/net/protocol/http/ResponseHeaderHandler.java index 4c5261da1..ca863440e 100644 --- a/gnu/java/net/protocol/http/ResponseHeaderHandler.java +++ b/gnu/java/net/protocol/http/ResponseHeaderHandler.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -52,6 +52,5 @@ public interface ResponseHeaderHandler * Sets the value for the header associated with this handler. */ void setValue(String value); - -} +} diff --git a/gnu/java/net/protocol/http/SimpleCookieManager.java b/gnu/java/net/protocol/http/SimpleCookieManager.java index fe05ba09e..f08204769 100644 --- a/gnu/java/net/protocol/http/SimpleCookieManager.java +++ b/gnu/java/net/protocol/http/SimpleCookieManager.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -133,6 +133,5 @@ public class SimpleCookieManager } } } - -} +} diff --git a/gnu/java/net/protocol/https/Handler.java b/gnu/java/net/protocol/https/Handler.java index 2b1375170..dbb619905 100644 --- a/gnu/java/net/protocol/https/Handler.java +++ b/gnu/java/net/protocol/https/Handler.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -73,4 +73,3 @@ public class Handler } } - diff --git a/gnu/java/net/protocol/jar/Connection.java b/gnu/java/net/protocol/jar/Connection.java index 386aacef6..85d27bfc9 100644 --- a/gnu/java/net/protocol/jar/Connection.java +++ b/gnu/java/net/protocol/jar/Connection.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -73,13 +73,13 @@ public final class Connection extends JarURLConnection private JarFile jar_file; private JarEntry jar_entry; private URL jar_url; - + public static class JarFileCache { private static Hashtable<URL, JarFile> cache = new Hashtable<URL, JarFile>(); private static final int READBUFSIZE = 4*1024; - + public static synchronized JarFile get (URL url, boolean useCaches) throws IOException { @@ -92,31 +92,31 @@ public final class Connection extends JarURLConnection } if ("file".equals (url.getProtocol())) - { - String fn = url.getFile(); - fn = gnu.java.net.protocol.file.Connection.unquote(fn); - File f = new File (fn); - jf = new JarFile (f, true, ZipFile.OPEN_READ); - } + { + String fn = url.getFile(); + fn = gnu.java.net.protocol.file.Connection.unquote(fn); + File f = new File (fn); + jf = new JarFile (f, true, ZipFile.OPEN_READ); + } else - { - URLConnection urlconn = url.openConnection(); - InputStream is = urlconn.getInputStream(); - byte[] buf = new byte [READBUFSIZE]; - File f = File.createTempFile ("cache", "jar"); - FileOutputStream fos = new FileOutputStream (f); - int len = 0; - - while ((len = is.read (buf)) != -1) - { - fos.write (buf, 0, len); - } - - fos.close(); - // Always verify the Manifest, open read only and delete when done. - jf = new JarFile (f, true, - ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); - } + { + URLConnection urlconn = url.openConnection(); + InputStream is = urlconn.getInputStream(); + byte[] buf = new byte [READBUFSIZE]; + File f = File.createTempFile ("cache", "jar"); + FileOutputStream fos = new FileOutputStream (f); + int len = 0; + + while ((len = is.read (buf)) != -1) + { + fos.write (buf, 0, len); + } + + fos.close(); + // Always verify the Manifest, open read only and delete when done. + jf = new JarFile (f, true, + ZipFile.OPEN_READ | ZipFile.OPEN_DELETE); + } if (useCaches) cache.put (url, jf); @@ -140,7 +140,7 @@ public final class Connection extends JarURLConnection jar_url = getJarFileURL(); jar_file = JarFileCache.get (jar_url, useCaches); String entry_name = getEntryName(); - + if (entry_name != null && !entry_name.equals ("")) { @@ -160,7 +160,7 @@ public final class Connection extends JarURLConnection if (! doInput) throw new ProtocolException("Can't open InputStream if doInput is false"); - + return jar_file.getInputStream (jar_entry); } @@ -179,26 +179,26 @@ public final class Connection extends JarURLConnection { try { - if (!connected) - connect(); + if (!connected) + connect(); - if (field.equals("content-type")) + if (field.equals("content-type")) return guessContentTypeFromName(getJarEntry().getName()); - else if (field.equals("content-length")) + else if (field.equals("content-length")) return Long.toString(getJarEntry().getSize()); - else if (field.equals("last-modified")) - { - // Both creating and manipulating dateFormat need synchronization. - synchronized (Connection.class) - { - if (dateFormat == null) - dateFormat = new SimpleDateFormat - ("EEE, dd MMM yyyy hh:mm:ss 'GMT'", - new Locale ("En", "Us", "Unix")); - - return dateFormat.format(new Date(getJarEntry().getTime())); - } - } + else if (field.equals("last-modified")) + { + // Both creating and manipulating dateFormat need synchronization. + synchronized (Connection.class) + { + if (dateFormat == null) + dateFormat = new SimpleDateFormat + ("EEE, dd MMM yyyy hh:mm:ss 'GMT'", + new Locale ("En", "Us", "Unix")); + + return dateFormat.format(new Date(getJarEntry().getTime())); + } + } } catch (IOException e) { @@ -222,11 +222,11 @@ public final class Connection extends JarURLConnection try { - return getJarEntry().getTime(); + return getJarEntry().getTime(); } catch (IOException e) { - return -1; + return -1; } } } diff --git a/gnu/java/net/protocol/jar/Handler.java b/gnu/java/net/protocol/jar/Handler.java index 66f0fb6d9..7d6103e93 100644 --- a/gnu/java/net/protocol/jar/Handler.java +++ b/gnu/java/net/protocol/jar/Handler.java @@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GNU Classpath 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 @@ -91,34 +91,34 @@ public class Handler extends URLStreamHandler // strategy when we encounter an error in parsing is to return without // doing anything. String file = url.getFile(); - + if (!file.equals("")) { //has context url - url_string = url_string.substring (start, end); + url_string = url_string.substring (start, end); if (url_string.startsWith("/")) { //url string is an absolute path int idx = file.lastIndexOf ("!/"); - - if (idx < 0) - throw new URLParseError("no !/ in spec"); - - file = file.substring (0, idx + 1) + url_string; + + if (idx < 0) + throw new URLParseError("no !/ in spec"); + + file = file.substring (0, idx + 1) + url_string; } else if (url_string.length() > 0) { int idx = file.lastIndexOf ("/"); if (idx == -1) //context path is weird - file = "/" + url_string; + file = "/" + url_string; else if (idx == (file.length() - 1)) //just concatenate two parts file = file + url_string; else - // according to Java API Documentation, here is a little different + // according to Java API Documentation, here is a little different // with URLStreamHandler.parseURL // but JDK seems doesn't handle it well file = file.substring(0, idx + 1) + url_string; } - + setURL (url, "jar", url.getHost(), url.getPort(), flat(file), null); return; } @@ -130,7 +130,7 @@ public class Handler extends URLStreamHandler return; if (start > url_string.length()) return; - + // Skip remains of protocol url_string = url_string.substring (start, end); @@ -140,16 +140,16 @@ public class Handler extends URLStreamHandler try { - new URL(url_string.substring (0, jar_stop)); + new URL(url_string.substring (0, jar_stop)); } catch (MalformedURLException e) { - throw new URLParseError("invalid inner URL: " + e.getMessage()); + throw new URLParseError("invalid inner URL: " + e.getMessage()); } - + if (!url.getProtocol().equals ("jar") ) throw new URLParseError("unexpected protocol " + url.getProtocol()); - + setURL (url, "jar", url.getHost(), url.getPort(), url_string, null); } @@ -170,16 +170,16 @@ public class Handler extends URLStreamHandler StringTokenizer st = new StringTokenizer(jar_path, "/"); while (st.hasMoreTokens()) { - String token = st.nextToken(); + String token = st.nextToken(); if (token.equals(".")) continue; else if (token.equals("..")) - { - if (! tokens.isEmpty()) - tokens.remove(tokens.size() - 1); - } - else - tokens.add(token); + { + if (! tokens.isEmpty()) + tokens.remove(tokens.size() - 1); + } + else + tokens.add(token); } CPStringBuilder path = new CPStringBuilder(url_string.length()); @@ -203,8 +203,8 @@ public class Handler extends URLStreamHandler String ref = url.getRef(); // return "jar:" + file; - // Performance!!: - // Do the concatenation manually to avoid resize StringBuffer's + // Performance!!: + // Do the concatenation manually to avoid resize StringBuffer's // internal buffer. The length of ref is not taken into consideration // as it's a rare path. CPStringBuilder sb = new CPStringBuilder (file.length() + 5); |