jcvsweb-1.4.3.zip

  • PUDN用户
    了解作者
  • Java
    开发工具
  • 5.3MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 22
    下载次数
  • 2009-11-26 16:32
    上传日期
WEB 操作CVS 的一个源码。。。。。。
jcvsweb-1.4.3.zip
内容介绍
/* ** Java cvs client library package. ** Copyright (c) 1997-2002 by Timothy Gerard Endres ** ** This program is free software. ** ** You may redistribute it and/or modify it under the terms of the GNU ** Library General Public License (LGPL) as published by the Free Software ** Foundation. ** ** Version 2 of the license should be included with this distribution in ** the file LICENSE.txt, as well as License.html. If the license is not ** included with this distribution, you may find a copy at the FSF web ** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the Free ** Software Foundation at 59 Temple Place - Suite 330, Boston, MA 02111 USA. ** ** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND, ** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR ** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY ** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR ** REDISTRIBUTION OF THIS SOFTWARE. ** */ package com.ice.cvsc; import java.io.*; import java.lang.*; import java.text.*; import java.util.*; import java.util.zip.*; /** * The CVSProject class implements the concept of a local * CVS project directory. A local project directory can be * thought of as a local source code working directory that * contains a CVS directory containing CVS administration files. * * Combined with CVSClient, this class provides everything * you need to communicate with a CVS Server and maintain * local working directories for CVS repositories. * * @version $Revision: 2.26 $ * @author Timothy Gerard Endres, <time@gjt.org>. * @see CVSClient * */ // // NOTES in code: // // NB-eol Nick Bower <nick@brainstorm.co.uk> // Nick Bower's EOL fix. The problem was that our line reader did // not include the EOL line termination. This made is impossible to // distinguish between an end-of-file line with no termination, and // a line that included termination. By explicitly returning the // EOL (and adjusting for its existence), we eliminate this problem. // The problem manifested as adding line termination to files that // lacked it on the last line. Some complained that it affected // binary files checked in as ascii. That is another issue entirely! // // MTT-delete Matthias Tichy <mtt@uni-paderborn.de> // Code to delete the local file when a "removed" command is received. // // MTT-null-list Matthias Tichy <mtt@uni-paderborn.de> // Fixed to properly handle a null file file. // // GG-dot-rep G�rard COLLIN <gcollin@netonomy.com> // When we see a repository string of ".", it should be ignored. // public class CVSProject extends Object implements CVSResponseHandler { static public final String RCS_ID = "$Id: CVSProject.java,v 2.26 2003/07/27 01:08:32 time Exp $"; static public final String RCS_REV = "$Revision: 2.26 $"; static private final String INFO_PREFIX = "# "; static private final String ERROR_PREFIX = "*** "; static private final String NOTICE_PREFIX = "==> "; static public boolean overTraceRequest = false; static public boolean overTraceResponse = false; static public boolean overTraceProcessing = false; static public boolean overTraceTCP = false; static public boolean deepDebug = false; static public boolean debugEntryIO = false; private boolean valid; private boolean isPServer; private boolean allowGzipFileMode; private int gzipStreamLevel; private int connMethod; private int connPort; private String serverCommand; private String rshProcess; private String userName; private String password; private String tempPath; private String repository; private String rootDirectory; private String localRootDirectory; private String[] setVars; private File localRootDirFile; private File localAdminDirFile; private CVSClient client; private CVSIgnore ignore; private CVSProjectDef projectDef; private CVSEntry rootEntry; private Hashtable pathTable; /** * Determines if a pathname, provided by the dirName * parameter, is a valid CVS administration directory * (i.e., is a directory named 'CVS'). * * @param dirName the pathname of the directory in question */ // UNDONE separator public static boolean isValidAdminPath( String dirName ) { if ( ! CVSCUtilities.caseSensitivePathNames() ) { dirName = dirName.toUpperCase(); CVSTracer.traceIf( CVSProject.deepDebug, "CVSProject.isValidAdminPath:\n" + " adjusted dirName to '" + dirName + "'" ); } return ( dirName.endsWith( "/CVS" ) || dirName.endsWith( "/CVS/" ) ); } /** * Given a root path, returns the administration directory * path corresponding to root's project. * * @param dirName the pathname of the root directory */ // UNDONE separator public static String rootPathToAdminPath( String dirName ) { return dirName + ( dirName.endsWith( "/" ) ? "" : "/" ) + "CVS"; } /** * Parses a valid CVS Administration Directory path * and returns the pathname of the working directory * that the administration directory belongs to. In * other words, it returns the directory's parent. * * @param dirName the pathname of the admin directory */ // UNDONE separator public static String adminPathToRootPath( String dirName ) { String path = dirName; if ( path.endsWith( "/" ) ) { path = path.substring( 0, (path.length() - 1) ); } int index = path.lastIndexOf( '/' ); if ( index < 0 ) { return path; } else { return path.substring( 0, index ); } } /** * Parses a valid CVS Entries File pathname and * returns the pathname of the admin directory * that the entries files belongs to. In other * words, it returns the directory's parent. * * @param entriesPath The pathname of the Entries file. */ // UNDONE separator public static String entriesPathToAdminPath( String entriesPath ) { int index = entriesPath.lastIndexOf( '/' ); if ( index < 0 ) { // UNDONE return null; } return entriesPath.substring( 0, index ); } /** * Verifies that a directory path is a valid CVS * administration directory. This checks for the * correct name ('CVS'), and that the necessary * files ('Entries', 'Root' and 'Repository') are * present. * * @param dirName the pathname of the admin directory * @return true if directory is valid, otherwise false */ public static boolean verifyAdminDirectory( String dirName ) { File file; CVSTracer.traceIf( (CVSProject.deepDebug || CVSProject.debugEntryIO), "CVSProject.verifyAdminDirectory:\n" + " dirName = '" + dirName + "'" ); if ( ! CVSProject.isValidAdminPath( dirName ) ) { CVSTracer.traceIf( (CVSProject.deepDebug || CVSProject.debugEntryIO), "CVSProject.verifyAdminDirectory:\n" + " IS NOT a valid admin directory." ); return false; } // NOTE // Do NOT export until after the verify, as it uses slashes! // dirName = CVSCUtilities.exportPath ( CVSCUtilities.stripFinalSlash( dirName ) ); file = new File( dirName, "Entries" ); if ( ! file.exists() ) { CVSTracer.traceIf( (CVSProject.deepDebug || CVSProject.debugEntryIO), "CVSProject.verifyAdminDirectory:\n" + " DOES NOT EXIST --> 'Entries'." ); return false; } file = new File( dirName, "Repository" ); if ( ! file.exists() ) { CVSTracer.traceIf( (CVSProject.deepDebug || CVSProject.debugEntryIO), "CVSProject.verifyAdminDirectory:\n" + " DOES NOT EXIST --> 'Repository'." ); return false; } file = new File( dirName, "Root" ); if ( ! file.exists() ) { CVSTracer.traceIf( (CVSProject.deepDebug || CVSProject.debugEntryIO), "CVSProje
评论
    相关推荐
    • BBS_system_on_java.rar
      BBS论坛系统由JAVA和JSP实现,开发中涉及JavaBean,JSP和服务器Tomcat5.0.7的设置,数据库用SQL2000。有注册登陆,浏览,发帖 回帖,帖子管理,论坛设置,管理版块,用户管理等模块。
    • 30184342396.rar
      jsp图书管理系统,自己看了,感觉还不错,用的mysql的数据库
    • online.rar
      jsp 在线客服 源码 实现在线聊天的功能
    • oa_09.rar
      oa办公系统 java+tomcat+mySQL实现
    • LibraryManage.rar
      是一个用jsp做前台,java做后台的图书管理系统,可供毕业设计做参考
    • demo.zip
      extjs与Struts整合以及与后台数据库的交互 非常值得学习的一个案例,仅供学习
    • exam.rar
      STRUTS的在线考试系统 数据库MYSQL 超完整,超好用的!
    • JSP+Servlet+JavaBean(MVC).rar
      此项目以JSP、servlet、JavaBean实现MVC三层架构.
    • shop.zip
      网上商城开发源码:jsp+servlet+javabean+DAO设计模式+前台+后台+数据库设计文件(mysql)
    • S2.rar
      小组做的一个旅游网站,比较基础,处理器都是用servlet实现的,数据库是sql2005