geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r697500 - in /geronimo/gshell/trunk: ./ gshell-remote/ gshell-remote/gshell-whisper-rfile/ gshell-remote/gshell-whisper-rfile/src/ gshell-remote/gshell-whisper-rfile/src/main/ gshell-remote/gshell-whisper-rfile/src/main/java/ gshell-remote/...
Date Sun, 21 Sep 2008 12:53:33 GMT
Author: jdillon
Date: Sun Sep 21 05:53:32 2008
New Revision: 697500

URL: http://svn.apache.org/viewvc?rev=697500&view=rev
Log:
More rfile protocol muck out of gshell-whisper into gshell-whisper-rfile

Added:
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/pom.xml   (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
  (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
  (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
  (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
  (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
  (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
  (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
  (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
  (with props)
    geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/resources/
Removed:
    geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/
Modified:
    geronimo/gshell/trunk/gshell-remote/pom.xml
    geronimo/gshell/trunk/pom.xml

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/pom.xml?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/pom.xml (added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/pom.xml Sun Sep 21 05:53:32 2008
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.gshell.remote</groupId>
+        <artifactId>gshell-remote</artifactId>
+        <version>1.0-alpha-2-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>gshell-whisper-rfile</artifactId>
+    <name>GShell Remote :: Whisper Remote File</name>
+    
+    <description>
+        Remote file URL muck for Whisper
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.gshell.remote</groupId>
+            <artifactId>gshell-whisper</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.gshell.support</groupId>
+            <artifactId>gshell-spring</artifactId>
+            <classifier>tests</classifier>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
(added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
Sun Sep 21 05:53:32 2008
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Message sent after we are all finished with the <tt>rfile</tt> connection.
+ *
+ * @version $Rev$ $Date$
+ */
+public class CloseFileMessage
+    extends BaseMessage
+{
+    //
+    // TODO: ???
+    //
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
(added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
Sun Sep 21 05:53:32 2008
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Holds onto a segment of a transfered file.
+ *
+ * @version $Rev$ $Date$
+ */
+public class FileSegmentMessage
+    extends BaseMessage
+{
+    //
+    // TODO: Add EOF and Fault responses ?
+    //
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
(added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
Sun Sep 21 05:53:32 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Message to initate a file transfer from remote to local.
+ *
+ * @version $Rev$ $Date$
+ */
+public class GetFileMessage
+    extends BaseMessage
+{
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
(added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
Sun Sep 21 05:53:32 2008
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Message sent to initiate an <tt>rfile</tt> connection.
+ *
+ * @version $Rev$ $Date$
+ */
+public class OpenFileMessage
+    extends BaseMessage
+{
+    //
+    // TODO: Response should contain file details or denial
+    //
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
(added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
Sun Sep 21 05:53:32 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Message to initate a file transfer from local to remote.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PutFileMessage
+    extends BaseMessage
+{
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
(added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
Sun Sep 21 05:53:32 2008
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.mina.common.IoFilterAdapter;
+
+/**
+ * Filter which handles the details of the <tt>rfile</tt> (remote-file) protocol.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RemoteFileFilter
+    extends IoFilterAdapter
+{
+    //
+    // TODO: Probably want to duplicate the StreamWriteHandler and massage it for our needs...
+    //
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
(added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
Sun Sep 21 05:53:32 2008
@@ -0,0 +1,217 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.Permission;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * URL connection <tt>rfile</tt> (remote-file) protocol.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RemoteFileURLConnection
+    extends URLConnection
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    
+    RemoteFileURLConnection(final URL url /* TODO: We need a session and some details */)
{
+        super(url);
+
+        //
+        // TODO: Probably need to have the session passed in?  And some initial file state
details er something?
+        //
+    }
+
+    @Override
+    public void connect() throws IOException {
+        //
+        // TODO:
+        //
+    }
+
+    //
+    // TODO: May want to lean on the Session<Input|Output>Stream impl here...
+    //
+
+    @Override
+    public InputStream getInputStream() throws IOException {
+        if (!connected) {
+            connect();
+        }
+
+        //
+        // TODO:
+        //
+
+        return null;
+    }
+
+    @Override
+    public OutputStream getOutputStream() throws IOException {
+        if (!connected) {
+            connect();
+        }
+
+        //
+        // TODO:
+        //
+
+        return null;
+    }
+
+    @Override
+    public Permission getPermission() throws IOException {
+        //
+        // TODO:
+        //
+        
+        /*
+        // Detect if we have read/write perms
+        String perms = null;
+
+        if (file.canRead()) {
+            perms = "read";
+        }
+
+        if (file.canWrite()) {
+            if (perms != null) {
+                perms += ",write";
+            }
+            else {
+                perms = "write";
+            }
+        }
+
+        // File perms need filename to be in system format
+        String filename = ParseUtil.decode(url.getPath());
+        if (File.separatorChar != '/') {
+            filename.replace('/', File.separatorChar);
+        }
+
+        return new FilePermission(filename, perms);
+        */
+
+        return null;
+    }
+
+    @Override
+    public long getLastModified() {
+        //
+        // TODO:
+        //
+
+        return -1;
+    }
+
+    @Override
+    public long getDate() {
+        //
+        // TODO:
+        //
+
+        return -1;
+    }
+
+    @Override
+    public int getContentLength() {
+        //
+        // TODO:
+        //
+
+        return -1;
+
+        /*
+        final long value = file.length();
+        if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) {
+            throw new IllegalStateException("Can not safly convert to int: " + value);
+        }
+
+        return (int) value;
+        */
+    }
+
+    @Override
+    public String getContentType() {
+        //return getFileNameMap().getContentTypeFor(file.getName());
+
+        //
+        // TODO:
+        //
+
+        return null;
+    }
+
+    @Override
+    public String getHeaderField(final String name) {
+        assert name != null;
+
+        String headerName = name.toLowerCase();
+
+        if (headerName.equals("last-modified")) {
+            return String.valueOf(getLastModified());
+        }
+        else if (headerName.equals("content-length")) {
+            return String.valueOf(getContentLength());
+        }
+        else if (headerName.equals("content-type")) {
+            return getContentType();
+        }
+        else if (headerName.equals("date")) {
+            return String.valueOf(getDate());
+        }
+
+        return super.getHeaderField(name);
+    }
+
+    @Override
+    public Map<String,List<String>> getHeaderFields() {
+        Map<String,List<String>> headers = new HashMap<String,List<String>>();
+
+        String[] headerNames = {
+            "last-modified",
+            "content-length",
+            "content-type",
+            "date"
+        };
+
+        for (String name : headerNames) {
+            List<String> list = new ArrayList<String>(1);
+
+            list.add(getHeaderField(name));
+
+            headers.put(name, Collections.unmodifiableList(list));
+        }
+
+        return Collections.unmodifiableMap(headers);
+    }
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java?rev=697500&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
(added)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
Sun Sep 21 05:53:32 2008
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * URL stream handler for the <tt>rfile</tt> (remote-file) protocol.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RemoteFileURLStreamHandler
+    extends URLStreamHandler
+{
+    public static final String PROTOCOL = "rfile";
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    
+    //
+    // TODO: We are going to need to get a handle on the current session to communicate with...
+    //
+
+    protected URLConnection openConnection(final URL url) throws IOException {
+        assert url != null;
+
+        String protocol = url.getProtocol();
+
+        if (!PROTOCOL.equals(protocol)) {
+            throw new IllegalArgumentException("Invalid protocol: " + protocol);
+        }
+
+        log.debug("Opening connection: {}", url);
+        
+        //
+        // TODO: Need to request the remote file transfer, and get back the basic file details
+        //       and then provide the connection below with the info and session to talk
over
+        //
+        // OpenFileMessage msg = new OpenFileMessage();
+
+        return new RemoteFileURLConnection(url /* TODO: Pass in state */);
+    }
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-whisper-rfile/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-remote/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/pom.xml?rev=697500&r1=697499&r2=697500&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/pom.xml (original)
+++ geronimo/gshell/trunk/gshell-remote/pom.xml Sun Sep 21 05:53:32 2008
@@ -41,6 +41,7 @@
     
     <modules>
         <module>gshell-whisper</module>
+        <module>gshell-whisper-rfile</module>
         <module>gshell-remote-common</module>
         <module>gshell-remote-client</module>
         <module>gshell-remote-server</module>

Modified: geronimo/gshell/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/pom.xml?rev=697500&r1=697499&r2=697500&view=diff
==============================================================================
--- geronimo/gshell/trunk/pom.xml (original)
+++ geronimo/gshell/trunk/pom.xml Sun Sep 21 05:53:32 2008
@@ -565,6 +565,12 @@
 
             <dependency>
                 <groupId>org.apache.geronimo.gshell.remote</groupId>
+                <artifactId>gshell-whisper-rfile</artifactId>
+                <version>1.0-alpha-2-SNAPSHOT</version>
+            </dependency>
+            
+            <dependency>
+                <groupId>org.apache.geronimo.gshell.remote</groupId>
                 <artifactId>gshell-remote-common</artifactId>
                 <version>1.0-alpha-2-SNAPSHOT</version>
             </dependency>



Mime
View raw message