ftp
所属分类:Ftp客户端
开发工具:Java
文件大小:65KB
下载次数:62
上传日期:2009-04-27 11:21:41
上 传 者:
278547986
说明: ftp服务器的源码,实现简单的ftp功能:
(source ftp server, ftp simple functions:)
文件列表:
ftp\users (25, 2009-04-27)
ftp\users.SAMPLE (41, 2001-10-04)
ftp\usersecurity.SAMPLE (29, 2001-10-04)
ftp\virtualroots.SAMPLE (17, 2009-04-11)
ftp\config (9, 2001-10-03)
ftp\config.SAMPLE (38, 2001-10-04)
ftp\CurrentConnectionsPanel.java (982, 2001-10-03)
ftp\FTPConnection.java (8456, 2001-10-03)
ftp\FTPObject.java (10569, 2001-10-03)
ftp\FTPParser.java (15383, 2001-10-04)
ftp\FTPPermission.java (3278, 2001-09-28)
ftp\ftpsecurity.SAMPLE (83, 2001-10-04)
ftp\FTPSecurityManager.java (3443, 2001-10-03)
ftp\FTPServer.java (9706, 2009-04-22)
ftp\FTPTransferHelper.java (2519, 2001-02-01)
ftp\FTPUser.java (4969, 2001-09-28)
ftp\MainWindow.java (593, 2000-12-21)
ftp\ObjectSelectionWindow.java (2954, 2001-10-04)
ftp\ObjectTreeNode.java (1195, 2001-01-05)
ftp\RootObjectManager.java (596, 2000-04-18)
ftp\ServerOptions.java (1120, 2001-02-02)
ftp\UserManagerPanel.java (10529, 2001-10-04)
ftp\FTPServer.class (6432, 2009-04-27)
ftp\FTPObject.class (6658, 2009-04-11)
ftp\MainWindow.class (1008, 2009-04-11)
ftp\CurrentConnectionsPanel.class (1564, 2009-04-11)
ftp\FTPConnection.class (7372, 2009-04-25)
ftp\FTPUser.class (3153, 2009-04-11)
ftp\FTPParser.class (10263, 2009-04-11)
ftp\FTPPermission.class (1365, 2009-04-25)
ftp\FTPSecurityManager.class (2257, 2009-04-11)
ftp\UserManagerPanel$PermListItem.class (678, 2009-04-11)
ftp\UserManagerPanel$1.class (1646, 2009-04-11)
ftp\UserManagerPanel$2.class (1293, 2009-04-11)
ftp\UserManagerPanel$3.class (1883, 2009-04-11)
ftp\UserManagerPanel$4.class (1101, 2009-04-11)
ftp\UserManagerPanel$5.class (865, 2009-04-11)
ftp\UserManagerPanel$6.class (865, 2009-04-11)
ftp\UserManagerPanel$7.class (933, 2009-04-11)
... ...
Wrabbit FTP Server (Alpha5)
README.TXT
October 4, 2001 - Charles Berube
----------------------------------------------------------------------
License and Copyright information
----------------------------------------------------------------------
Copyright (c) 2000-2001 Charles R Berube
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------
Distribution notes
----------------------------------------------------------------------
Please use and distribute both widely and freely this software
package. If you feel so inclined, contributions in any form from
co-developers, testers and critics, are all welcome. See the contact
information for the URL to the SourceForge project site, which
provides message boards, bug tracking, FTP, CVS, and more related
to Wrabbit.
----------------------------------------------------------------------
Contact information
----------------------------------------------------------------------
Charles Berube (Original Author)
cberube@orderlychaos.com
http://www.orderlychaos.com
The Wrabbit FTPServer SourceForge Project
http://sourceforge.net/project/?group_id=4728
ftp://wrabbitftp.sourceforge.net/pub/wrabbitftp
Anonymous and developer CVS instructions can be found on SourceForge's
site.
----------------------------------------------------------------------
Introduction to the Wrabbit FTPServer
----------------------------------------------------------------------
Wrabbit is an FTP server written entirely in Java. It provides
a somewhat unique system for representing files, and implements
both file/directory based and user based security systems.
The following subsections address some specific issues with
the current version of Wrabbit.
======================================================================
What is the current version?
And what does that mean we can expect from it?
======================================================================
The current version of Wrabbit is Alpha5.
This means the you can expect to find bugs from time to time, a
lack of a clean user interface, and a lot of features that are
still only partially implemented, if at all.
It also means that you will find a fairly stable core FTP server,
which quite happily transfers files in both directions, and
certainly has it's uses.
======================================================================
How does Wrabbit view files in the system?
======================================================================
Wrabbit represents all files and directories (and for that matter
drives and "virtual roots") as "objects". This type of implementation
was choosen to add a layer of abstraction between the actual file
system and the server.
Objects can be considered just as files and directories for most
practical purposes. For example, the path (on a Windows machine)
"c:\windows" is represented as "root\Local Disk C\windows" to the
server, but the two refer to exactly the same part of the file
system.
Objects are, just like directories, hierarchical, and always begin at
the root object. Objects also have complete path names just as files
and directories do, and they use the backslash ("\") as their
separator, regardless of the underlying file system.
One reason for the use of an object based, rather then directly file
based representation of data inside the server is to support features
such as "sub-file resolution" in the future, in which a file is
treated as a "directory" of sorts, and segments of the file become
independent files available for download (e.g. a single document might
be broken into chapters).
======================================================================
Why doesn't Wrabbit assume I want to hide everything but a few files?
======================================================================
The mentality behind Wrabbit is that most files are eligible for
at least some kind of sharing. Because of this, Wrabbit, by default,
exposes your entire computer to outside users.
It is possible to hide everything and then selectively expose parts
of your computer by hiding every Local Disk and then creating
virtual roots which point to the files you wish to allow others
to access.
======================================================================
What platforms will Wrabbit run on?
======================================================================
From a purely technical standpoint, Wrabbit will run on any platform
that supports Java.
Practically speaking, however, this version will most likely not
function on non-Windows machines.
----------------------------------------------------------------------
About this ditribution of the Wrabbit FTPServer
----------------------------------------------------------------------
This package contains both compiled class files and Java source files
for the Wrabbit FTPServer. You should be able to run the server
without compiling.
Sample configuration files are also included, named as
configfilename.SAMPLE. These samples should not be used when actually
running the server, as they may not apply to your system. They should
provide a useful reference for setting up your own configuration.
If you do wish to compile the server, see the last section of this
readme.
----------------------------------------------------------------------
Running the Wrabbit FTPServer
----------------------------------------------------------------------
After configuration files have been set up (see the following
sections) running Wrabbit should be straightforward. The following
command should work from the directory in which the .class files
are stored (note that Java is case sensitive):
java FTPServer
If it fails, a common error is a classpath problem. The first step
in fixing such a problem is to attempt this:
java -cp . FTPServer
If this command fails, an alternative may succeed:
java -cp %classpath%;. FTPServer
If this command also fails, chances are the problem is either that
Java cannot find it's own internal libraries (which should not be
the case) or that something other then the classpath is causing the
error.
* * * * * * * * * * * * * * * * * *
Note: Ensure that the java.exe file is in your path. This file
is generally installed in as inconvienent a location as possible,
such as:
c:\Program Files\javasoft\jdk1.2\bin\jave.exe
or, perhaps
c:\Program Files\javasoft\jre\bin\java.exe
* * * * * * * * * * * * * * * * * *
If either the classpath or your standard path are determined to be
the problem, it is probably ideal to update your autoexec.bat file
to contain the correct settings.
As a sidenote, it is often advantageous to ensure that the directory
"." (a single period) is part of the classpath, as Java may not look
in the current directory for class files otherwise.
======================================================================
Command Line Parameters
======================================================================
Wrabbit supports the following command line parameters:
-gui
Runs the FTPServer and displays the configuration and
management window.
-guionly
Displays the configuration and management window but does no
run the FTPServer. Use this option to make configuration
changes without actually starting the server.
-config
Uses the file instead of the standard file,
'config', for all configuration settings. This makes it
easier to run multiple servers with different settings on a
single machine.
----------------------------------------------------------------------
Configuring the Wrabbit FTPServer
----------------------------------------------------------------------
A number of configuration files are currently used by the Wrabbit FTP
Server, they are (non of the files have an extension):
config
Defines the general configuration settings for the
server
users
Defines a list of users and their associated passwords
ftpsecurity
Defines permissions for all the objects in the system
usersecurity
Defines permissions for individual users
virtualroots
Defines virtual roots for the server
======================================================================
The "config" file
======================================================================
The config file supports the following options:
port:
Where is the number of the port you would like to run
the server on. If the configuration file is missing a warning
will be displayed and the default port (21) will be used.
virtualrootsfile:
Where is the name of the file to read to create
virtual roots (described in more detail later). If this
option is absent the default filename of 'virtualroots'
is used.
======================================================================
The "users" file
======================================================================
This file defines the usernames and passwords of any who may log in to
the FTP server. It may contain any number of lines of the form:
username:password
For instance:
george:bud44
bill:ice99
Only one username and password pair may be present on a single line.
======================================================================
The "ftpsecurity" file
======================================================================
This file is used to specify permissions for files and directories on
the server. It's lines are of the form:
objectname:permission
or
objectname:permission:username
In the first case, a global permission is assigned to a given object.
The object is defined the same was as it would be in the usersecurity
file (beginning with "root", etc).
The only supported permission at this time is "HiddenFilePermission"
(no spaces, no quotes). The hidden file permission hides a single
object (including files and directories) from view.
The second form of entry adds a username to the line and may be
used to apply a permission only to a certain user. For example, to
hide the D drive from only the user "bill" we could write:
root\Local Disk D:HiddenFilePermission:bill
======================================================================
The "usersecurity" file
======================================================================
This file defines permissions for individual users. It is currently
not a very "pretty" manner in which to specify such information, and
a GUI is planned in the near future.
Each line of this file is of the form:
username:permission
or
username:permission:object
In the first case a single valid username is given a single, global
permission. Currently the only supported permission is
"ViewHiddenFilesPermission" (no spaces, no quotes).
The ViewHiddenFilesPermission does exactly what it implies: it allows
a user to see files which have been hidden (defined in the
ftpsecurity file).
It is not always desireable to allow a user to view all hidden files,
however. Therefore, it is possible to allow a user to see only
specific hidden files with the second type of entry.
In that case, object is the full path to an file or directory against
which the permission functions. For example, to allow a user to see
the Windows directory on the C drive (which we assume for this example
has been hidden), the following could be used:
username:ViewHiddenFilesPermission:root\Local Disk C\Windows
Note some key points about the object name:
* It always begins with root
* It uses backslashes to seperate directories (regardless of platform)
* It includes the drive letter in the form "Local Disk C"
Wrabbit FTP allows access to all the drives on the serving computer as
if they were directories. These "drive-directories" are always named
"Local Disk X" where X is the drive letter.
The initial "root" is not operating system specific in any way, and
is always the highest level object. (Future version may allow
the leading root to be omitted, but it is currently required.)
The object name is not case sensitive, but it is white-space sensitive
and, of course, must be spelled corrently.
======================================================================
The "virtualroots" file
======================================================================
This file can be used to define a "virtual root", a top level
directory which points into another directory. Virtual roots are
displayed at the top level, just as "Local Disk" entries are. They
may point to any valid path in the system. Entries in this file
are always in pairs of lines, arranged like this:
virtual_root_name
full_real_path
The first line names the virtual root. The name may contain spaces.
The second line defines the full path to the directory on the local
machine to which the virtual root points. For example, to create
a virtual root which points at an MP3 collection, we could write:
MP3 Files
c:\downloads\audio\music\mp3s
Note that the path is in the system's native format in this case. This
may or may not be case sensitive, depending on the system.
If Wrabbit is not able to find the path entered, it will display a
warning and the virtual root will not be created.
It is important to understand that virtual roots do not in any way
inherit any kind of permissions from the drives or directories they
point to. For example, if Local Disk C is hidden from all users,
and a virtual root points at a directory on drive C the virtual root
WILL NOT BE HIDDEN.
This is generally beneficial, as it allows, for example, all the local
drives to be hidden, and then only selected sections of them
exposed to remote users.
----------------------------------------------------------------------
A brief mention of the priority of security settings
----------------------------------------------------------------------
Security is evaluted in a specific order:
1. A general denial permission is the lowest level.
2. Specific allowances override general denials for the objects they
refer to (e.g. the ability of Bill to see Local Disk C overrides a
general hidden file permission for Local Disk C)
3. General allowances override general denials for all objects (e.g.
the ability of John to see hidden files overrides a general
hidden file permission for Local Disk C, Local Disk E, and Local
Disk F).
4. Specific denials have the highest priority. For example: Rick's
ability to see Local Disk C is overridden by a hidden file
permission on Local Disk C which specifies Rick directly.
Likewise, Rob's general permission to see hidden files is
overridden by a permission on Local Disk D which hides it
specifically from Rob.
----------------------------------------------------------------------
Compiling the Wrabbit FTPServer from the Java source files
----------------------------------------------------------------------
Wrabbit should compile happily with just the following command
executed from the directory containing the source files:
javac *.java
近期下载者:
相关文件:
收藏者: