incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: incubator-ftpserver/bin appendcp.bat ftpd.bat ftpd.sh ftpd_ui.bat ftpd_ui.sh
Date Thu, 06 Oct 2005 05:48:38 GMT
rana_b      2005/10/05 22:48:37

  Added:       bin      appendcp.bat ftpd.bat ftpd.sh ftpd_ui.bat
                        ftpd_ui.sh
  Log:
  single set of scripts - standard directory
  
  Revision  Changes    Path
  1.1                  incubator-ftpserver/bin/appendcp.bat
  
  Index: appendcp.bat
  ===================================================================
  
  rem Copyright 2002-2004 The Apache Software Foundation or its licensors,
  rem as applicable.
  rem
  rem Licensed under the Apache License, Version 2.0 (the "License");
  rem you may not use this file except in compliance with the License.
  rem You may obtain a copy of the License at
  rem
  rem     http://www.apache.org/licenses/LICENSE-2.0
  rem
  rem Unless required by applicable law or agreed to in writing, software
  rem distributed under the License is distributed on an "AS IS" BASIS,
  rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  rem See the License for the specific language governing permissions and
  rem limitations under the License.
  
  If %OS%'==Windows_NT' Set NTSwitch=/F "Tokens=*"
  If %OS%'==WINNT' Set NTSwitch=/F "Tokens=*"
  For %NTSwitch% %%V In (%1) Do set FTPD_CLASSPATH=%FTPD_CLASSPATH%;%%V
  
  
  
  
  
  1.1                  incubator-ftpserver/bin/ftpd.bat
  
  Index: ftpd.bat
  ===================================================================
  @echo off
  
  rem Copyright 2002-2004 The Apache Software Foundation or its licensors,
  rem as applicable.
  rem
  rem Licensed under the Apache License, Version 2.0 (the "License");
  rem you may not use this file except in compliance with the License.
  rem You may obtain a copy of the License at
  rem
  rem     http://www.apache.org/licenses/LICENSE-2.0
  rem
  rem Unless required by applicable law or agreed to in writing, software
  rem distributed under the License is distributed on an "AS IS" BASIS,
  rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  rem See the License for the specific language governing permissions and
  rem limitations under the License.
  
  if "%OS%"=="Windows_NT" @setlocal
  if "%OS%"=="WINNT" @setlocal
  
  rem ----- use the location of this script to infer $FTPD_HOME -------
  if NOT "%OS%"=="Windows_NT" set DEFAULT_FTPD_HOME=..
  if "%OS%"=="Windows_NT" set DEFAULT_FTPD_HOME=%~dp0\..
  if "%OS%"=="WINNT" set DEFAULT_FTPD_HOME=%~dp0\..
  if "%FTPD_HOME%"=="" set FTPD_HOME=%DEFAULT_FTPD_HOME%
  
  rem ----- Create CLASSPATH --------------------------------------------
  set FTPD_CLASSPATH=%CLASSPATH%;%FTPD_HOME%\common\classes;%FTPD_HOME%\target\classes;
  cd /d "%FTPD_HOME%\common\lib"
  for %%i in ("*.jar") do call "%FTPD_HOME%\bin\appendcp.bat" "%FTPD_HOME%\common\lib\%%i"
  cd /d %FTPD_HOME%
  
  rem ----- call java.. ---------------------------------------------------
  set MAIN_CLASS=org.apache.ftpserver.FtpServer
  set JAVA_CMD=%JAVA_HOME%\bin\java
  "%JAVA_CMD%" -classpath "%FTPD_CLASSPATH%" %MAIN_CLASS% %*
  
  
  
  1.1                  incubator-ftpserver/bin/ftpd.sh
  
  Index: ftpd.sh
  ===================================================================
  #!/bin/sh
  
  # Copyright 2002-2004 The Apache Software Foundation or its licensors,
  # as applicable.
  #
  # Licensed 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.
  
  #
  # OS specific support.  $var _must_ be set to either true or false.
  #
  cygwin=false;
  darwin=false;
  case "`uname`" in
    CYGWIN*) cygwin=true ;;
    Darwin*) darwin=true
             if [ -z "$JAVA_HOME" ] ; then
               JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
             fi
             ;;
  esac
  
  #
  # Get the FTPD_HOME variable
  #
  if [ -z "$FTPD_HOME" ] ; then
    # use the location of this script to infer $FTPD_HOME
    whoami=`basename $0`
    whereami=`echo $0 | sed -e "s#^[^/]#\`pwd\`/&#"`
    whereami=`dirname $whereami`
  
    # Resolve any symlinks of the now absolute path, $whereami
    realpath_listing=`ls -l $whereami/$whoami`
    case "$realpath_listing" in
      *-\>\ /*)
        realpath=`echo $realpath_listing | sed -e "s#^.*-> ##"`
        ;;
      *-\>*)
        realpath=`echo $realpath_listing | sed -e "s#^.*-> #$whereami/#"`
        ;;
      *)
        realpath=$whereami/$whoami
        ;;
    esac
    FTPD_HOME=`dirname "$realpath"`/..
  fi
  
  
  #
  # For Cygwin, ensure paths are in UNIX format before anything is touched
  #
  if $cygwin ; then
    [ -n "$FTPD_HOME" ] &&
      FTPD_HOME=`cygpath --unix "$FTPD_HOME"`
    [ -n "$JAVA_HOME" ] &&
      JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  fi
  
  
  #
  # Get the Java command
  #
  if [ -z "$JAVACMD" ] ; then
    if [ -n "$JAVA_HOME"  ] ; then
      if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
      else
        JAVACMD="$JAVA_HOME/bin/java"
      fi
    else
      JAVACMD=`which java 2> /dev/null `
      if [ -z "$JAVACMD" ] ; then
          JAVACMD=java
      fi
    fi
  fi
  
  if [ ! -x "$JAVACMD" ] ; then
    echo "Error: JAVA_HOME is not defined correctly."
    echo "  We cannot execute $JAVACMD"
    exit 1
  fi
  
  
  #
  # Get the path separator
  #
  if [ "$cygwin" = "true" ] ; then
    S=';'
  else
    S=':'
  fi
  
  
  #
  # Build classpath
  #
  if [ "$cygwin" = "true" ] ; then
      FTPD_CLASSPATH=$CLASSPATH$S`cygpath -w $FTPD_HOME/common/classes`$S`cygpath -w $FTPD_HOME/target/classes`
  else
      FTPD_CLASSPATH=$CLASSPATH$S$FTPD_HOME/common/classes$S$FTPD_HOME/target/classes
  fi
  
  for i in $FTPD_HOME/common/lib/*.jar; do
    if [ "$cygwin" = "true" ] ; then
      LIB=`cygpath -w $i`
    else
      LIB=$i
    fi
  
    FTPD_CLASSPATH=$FTPD_CLASSPATH$S$LIB
  done
  
  
  #
  # Execute command
  #
  CURR_DIR=`pwd`
  cd $FTPD_HOME
  MAIN_CLASS=org.apache.ftpserver.FtpServer
  "$JAVACMD" -classpath "$FTPD_CLASSPATH" $MAIN_CLASS $@
  RESULT=$?
  cd $CURR_DIR
  exit $RESULT
  
  
  
  1.1                  incubator-ftpserver/bin/ftpd_ui.bat
  
  Index: ftpd_ui.bat
  ===================================================================
  @echo off
  
  rem Copyright 2002-2004 The Apache Software Foundation or its licensors,
  rem as applicable.
  rem
  rem Licensed under the Apache License, Version 2.0 (the "License");
  rem you may not use this file except in compliance with the License.
  rem You may obtain a copy of the License at
  rem
  rem     http://www.apache.org/licenses/LICENSE-2.0
  rem
  rem Unless required by applicable law or agreed to in writing, software
  rem distributed under the License is distributed on an "AS IS" BASIS,
  rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  rem See the License for the specific language governing permissions and
  rem limitations under the License.
  
  if "%OS%"=="Windows_NT" @setlocal
  if "%OS%"=="WINNT" @setlocal
  
  rem ----- use the location of this script to infer $FTPD_HOME -------
  if NOT "%OS%"=="Windows_NT" set DEFAULT_FTPD_HOME=..
  if "%OS%"=="Windows_NT" set DEFAULT_FTPD_HOME=%~dp0\..
  if "%OS%"=="WINNT" set DEFAULT_FTPD_HOME=%~dp0\..
  if "%FTPD_HOME%"=="" set FTPD_HOME=%DEFAULT_FTPD_HOME%
  
  rem ----- Create CLASSPATH --------------------------------------------
  set FTPD_CLASSPATH=%CLASSPATH%;%FTPD_HOME%\common\classes;%FTPD_HOME%\target\classes;
  cd /d "%FTPD_HOME%\common\lib"
  for %%i in ("*.jar") do call "%FTPD_HOME%\bin\appendcp.bat" "%FTPD_HOME%\common\lib\%%i"
  cd /d %FTPD_HOME%
  
  rem ----- call java.. ---------------------------------------------------
  set MAIN_CLASS=org.apache.ftpserver.gui.ServerFrame
  set JAVA_CMD=%JAVA_HOME%\bin\java
  "%JAVA_CMD%" -classpath "%FTPD_CLASSPATH%" %MAIN_CLASS% %*
  
  
  
  1.1                  incubator-ftpserver/bin/ftpd_ui.sh
  
  Index: ftpd_ui.sh
  ===================================================================
  #!/bin/sh
  
  # Copyright 2002-2004 The Apache Software Foundation or its licensors,
  # as applicable.
  #
  # Licensed 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.
  
  #
  # OS specific support.  $var _must_ be set to either true or false.
  #
  cygwin=false;
  darwin=false;
  case "`uname`" in
    CYGWIN*) cygwin=true ;;
    Darwin*) darwin=true
             if [ -z "$JAVA_HOME" ] ; then
               JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
             fi
             ;;
  esac
  
  #
  # Get the FTPD_HOME variable
  #
  if [ -z "$FTPD_HOME" ] ; then
    # use the location of this script to infer $FTPD_HOME
    whoami=`basename $0`
    whereami=`echo $0 | sed -e "s#^[^/]#\`pwd\`/&#"`
    whereami=`dirname $whereami`
  
    # Resolve any symlinks of the now absolute path, $whereami
    realpath_listing=`ls -l $whereami/$whoami`
    case "$realpath_listing" in
      *-\>\ /*)
        realpath=`echo $realpath_listing | sed -e "s#^.*-> ##"`
        ;;
      *-\>*)
        realpath=`echo $realpath_listing | sed -e "s#^.*-> #$whereami/#"`
        ;;
      *)
        realpath=$whereami/$whoami
        ;;
    esac
    FTPD_HOME=`dirname "$realpath"`/..
  fi
  
  
  #
  # For Cygwin, ensure paths are in UNIX format before anything is touched
  #
  if $cygwin ; then
    [ -n "$FTPD_HOME" ] &&
      FTPD_HOME=`cygpath --unix "$FTPD_HOME"`
    [ -n "$JAVA_HOME" ] &&
      JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  fi
  
  
  #
  # Get the Java command
  #
  if [ -z "$JAVACMD" ] ; then
    if [ -n "$JAVA_HOME"  ] ; then
      if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
      else
        JAVACMD="$JAVA_HOME/bin/java"
      fi
    else
      JAVACMD=`which java 2> /dev/null `
      if [ -z "$JAVACMD" ] ; then
          JAVACMD=java
      fi
    fi
  fi
  
  if [ ! -x "$JAVACMD" ] ; then
    echo "Error: JAVA_HOME is not defined correctly."
    echo "  We cannot execute $JAVACMD"
    exit 1
  fi
  
  
  #
  # Get the path separator
  #
  if [ "$cygwin" = "true" ] ; then
    S=';'
  else
    S=':'
  fi
  
  
  #
  # Build classpath
  #
  if [ "$cygwin" = "true" ] ; then
      FTPD_CLASSPATH=$CLASSPATH$S`cygpath -w $FTPD_HOME/common/classes`$S`cygpath -w $FTPD_HOME/target/classes`
  else
      FTPD_CLASSPATH=$CLASSPATH$S$FTPD_HOME/common/classes$S$FTPD_HOME/target/classes
  fi
  
  for i in $FTPD_HOME/common/lib/*.jar; do
    if [ "$cygwin" = "true" ] ; then
      LIB=`cygpath -w $i`
    else
      LIB=$i
    fi
  
    FTPD_CLASSPATH=$FTPD_CLASSPATH$S$LIB
  done
  
  
  #
  # Execute command
  #
  CURR_DIR=`pwd`
  cd $FTPD_HOME
  MAIN_CLASS=org.apache.ftpserver.gui.ServerFrame
  "$JAVACMD" -classpath "$FTPD_CLASSPATH" $MAIN_CLASS $@
  RESULT=$?
  cd $CURR_DIR
  exit $RESULT
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message