├── README.md └── mydisks ├── .classpath ├── .mymetadata ├── .project ├── .settings ├── .jsdtscope ├── org.eclipse.jdt.core.prefs ├── org.eclipse.wst.common.component ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.jsdt.ui.superType.container └── org.eclipse.wst.jsdt.ui.superType.name ├── WebRoot ├── META-INF │ └── MANIFEST.MF ├── WEB-INF │ ├── lib │ │ ├── activation.jar │ │ ├── c3p0-0.9.2-pre1.jar │ │ ├── c3p0-oracle-thin-extras-0.9.2-pre1.jar │ │ ├── commons-beanutils-1.8.3.jar │ │ ├── commons-collections-3.2.1.jar │ │ ├── commons-dbutils-1.4.jar │ │ ├── commons-fileupload-1.3.1.jar │ │ ├── commons-io-2.4.jar │ │ ├── commons-lang-2.5.jar │ │ ├── commons-logging-1.2.jar │ │ ├── ezmorph-1.0.6.jar │ │ ├── itcast-tools-1.4.2.jar │ │ ├── json-lib-2.4-jdk15.jar │ │ ├── mchange-commons-0.2.jar │ │ └── mysql-connector-java-5.1.13-bin.jar │ └── web.xml ├── css │ ├── bootstrap.css │ ├── remodal-default-theme.css │ ├── remodal.css │ └── reset.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── home.jsp ├── images │ ├── 01.png │ ├── 02.png │ ├── 03.png │ ├── 04.png │ ├── 1024.png │ ├── apk.jpg │ ├── back1.jpg │ ├── banner1.jpg │ ├── banner2.jpg │ ├── check.png │ ├── down.png │ ├── exe.jpg │ ├── falut.png │ ├── folder.png │ ├── jepg.jpg │ ├── logo1.png │ ├── logo_small.png │ ├── more.png │ ├── music.jpg │ ├── navback.jpg │ ├── notfound.png │ ├── others.jpg │ ├── reback1.jpg │ ├── save.png │ ├── sign-check-icon.png │ ├── sign.jpg │ ├── spare.png │ ├── user.jpg │ ├── video.jpg │ ├── welcome.jpg │ ├── yz.jpg │ └── zip.jpg ├── index.jsp └── js │ ├── bootstrap.js │ ├── jquery.min.js │ └── login.js └── src ├── c3p0-config.xml └── lz └── xawl ├── Catalog ├── dao │ └── CatalogDao.java ├── domain │ └── Catalog.java ├── service │ └── CatalogService.java └── servlet │ └── CatalogServlet.java ├── File ├── dao │ └── FileDao.java ├── domain │ └── File.java ├── service │ └── FileService.java └── servlet │ ├── DownLoadServlet.java │ ├── FileServlet.java │ ├── ProgressServlet.java │ ├── UploadServlet.java │ ├── fileUploadStatus.java │ └── myProgressListener.java └── Util └── Tool.java /README.md: -------------------------------------------------------------------------------- 1 | # disk 2 | 网盘系统 3 | 4 | 5 | 6 | 使用java做的一个网盘系统,实现上传,下载,删除,分享等功能。 7 | 数据库: 8 | /* 9 | SQLyog Professional v12.09 (64 bit) 10 | MySQL - 5.6.21 : Database - drive 11 | ********************************************************************* 12 | */ 13 | 14 | 15 | /*!40101 SET NAMES utf8 */; 16 | 17 | /*!40101 SET SQL_MODE=''*/; 18 | 19 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 20 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 21 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 22 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 23 | CREATE DATABASE /*!32312 IF NOT EXISTS*/`drive` /*!40100 DEFAULT CHARACTER SET utf8 */; 24 | 25 | USE `drive`; 26 | 27 | /*Table structure for table `catalog` */ 28 | 29 | DROP TABLE IF EXISTS `catalog`; 30 | 31 | CREATE TABLE `catalog` ( 32 | `cId` varchar(50) NOT NULL, 33 | `pId` varchar(50) DEFAULT NULL, 34 | `cName` varchar(50) DEFAULT NULL, 35 | `cDate` varchar(50) DEFAULT NULL, 36 | `cF` varchar(50) DEFAULT NULL, 37 | `isShare` varchar(2) DEFAULT NULL, 38 | PRIMARY KEY (`cId`) 39 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 40 | 41 | /*Table structure for table `catalog_file` */ 42 | 43 | DROP TABLE IF EXISTS `catalog_file`; 44 | 45 | CREATE TABLE `catalog_file` ( 46 | `cf` varchar(50) NOT NULL, 47 | `fid` varchar(50) DEFAULT NULL, 48 | KEY `cf` (`cf`) 49 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 50 | 51 | /*Table structure for table `file` */ 52 | 53 | DROP TABLE IF EXISTS `file`; 54 | 55 | CREATE TABLE `file` ( 56 | `fId` varchar(50) NOT NULL, 57 | `fPath` text, 58 | `fSize` int(50) DEFAULT NULL, 59 | `fType` varchar(50) DEFAULT NULL, 60 | `fName` varchar(50) DEFAULT NULL, 61 | `fHash` varchar(50) DEFAULT NULL, 62 | `fDowncount` int(11) DEFAULT NULL, 63 | `fDesc` varchar(50) DEFAULT NULL, 64 | `fUploadtime` date DEFAULT NULL, 65 | `isShare` bigint(2) DEFAULT NULL, 66 | `cId` varchar(50) DEFAULT NULL, 67 | `fDiskName` varchar(50) DEFAULT NULL, 68 | PRIMARY KEY (`fId`) 69 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 70 | 71 | /*Table structure for table `info` */ 72 | 73 | DROP TABLE IF EXISTS `info`; 74 | 75 | CREATE TABLE `info` ( 76 | `iId` varchar(50) NOT NULL, 77 | `iTitle` varchar(100) DEFAULT NULL, 78 | `iContent` text, 79 | `iTime` varchar(50) DEFAULT NULL, 80 | `iImage` varchar(500) DEFAULT NULL, 81 | `isImage` int(11) DEFAULT NULL, 82 | `iLocation` int(11) DEFAULT NULL, 83 | `iStart` int(11) DEFAULT NULL, 84 | PRIMARY KEY (`iId`) 85 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 86 | 87 | /*Table structure for table `role` */ 88 | 89 | DROP TABLE IF EXISTS `role`; 90 | 91 | CREATE TABLE `role` ( 92 | `role` varchar(20) DEFAULT NULL 93 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 94 | 95 | /*Table structure for table `user` */ 96 | 97 | DROP TABLE IF EXISTS `user`; 98 | 99 | CREATE TABLE `user` ( 100 | `uId` varchar(55) NOT NULL, 101 | `userName` varchar(50) DEFAULT NULL, 102 | `uPassword` varchar(50) DEFAULT NULL, 103 | `cId` varchar(50) DEFAULT NULL, 104 | `uTime` varchar(50) DEFAULT NULL, 105 | `role` varchar(50) DEFAULT NULL, 106 | `fileSize` varchar(100) DEFAULT NULL, 107 | PRIMARY KEY (`uId`) 108 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 109 | 110 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 111 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 112 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 113 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 114 | -------------------------------------------------------------------------------- /mydisks/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mydisks/.mymetadata: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mydisks/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | mydisks 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.common.project.facet.core.builder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.jsdt.core.javascriptValidator 15 | 16 | 17 | 18 | 19 | com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.jdt.core.javabuilder 25 | 26 | 27 | 28 | 29 | com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator 30 | 31 | 32 | 33 | 34 | com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator 35 | 36 | 37 | 38 | 39 | org.eclipse.wst.validation.validationbuilder 40 | 41 | 42 | 43 | 44 | com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder 45 | 46 | 47 | 48 | 49 | 50 | com.genuitec.eclipse.ast.deploy.core.deploymentnature 51 | org.eclipse.jem.workbench.JavaEMFNature 52 | com.genuitec.eclipse.j2eedt.core.webnature 53 | org.eclipse.jdt.core.javanature 54 | org.eclipse.wst.jsdt.core.jsNature 55 | org.eclipse.wst.common.project.facet.core.nature 56 | org.eclipse.wst.common.modulecore.ModuleCoreNature 57 | 58 | 59 | -------------------------------------------------------------------------------- /mydisks/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /mydisks/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 4 | org.eclipse.jdt.core.compiler.compliance=1.5 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.5 8 | -------------------------------------------------------------------------------- /mydisks/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mydisks/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /mydisks/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /mydisks/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /mydisks/WebRoot/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/activation.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/activation.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/c3p0-0.9.2-pre1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/c3p0-0.9.2-pre1.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/c3p0-oracle-thin-extras-0.9.2-pre1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/c3p0-oracle-thin-extras-0.9.2-pre1.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/commons-beanutils-1.8.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/commons-beanutils-1.8.3.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/commons-collections-3.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/commons-collections-3.2.1.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/commons-dbutils-1.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/commons-dbutils-1.4.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/commons-fileupload-1.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/commons-fileupload-1.3.1.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/commons-io-2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/commons-io-2.4.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/commons-lang-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/commons-lang-2.5.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/ezmorph-1.0.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/ezmorph-1.0.6.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/itcast-tools-1.4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/itcast-tools-1.4.2.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/json-lib-2.4-jdk15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/json-lib-2.4-jdk15.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/mchange-commons-0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/mchange-commons-0.2.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.13-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.13-bin.jar -------------------------------------------------------------------------------- /mydisks/WebRoot/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This is the description of my J2EE component 5 | This is the display name of my J2EE component 6 | CatalogServlet 7 | lz.xawl.Catalog.servlet.CatalogServlet 8 | 9 | 10 | This is the description of my J2EE component 11 | This is the display name of my J2EE component 12 | DownLoadServlet 13 | lz.xawl.File.servlet.DownLoadServlet 14 | 15 | 16 | This is the description of my J2EE component 17 | This is the display name of my J2EE component 18 | FileServlet 19 | lz.xawl.File.servlet.FileServlet 20 | 21 | 22 | This is the description of my J2EE component 23 | This is the display name of my J2EE component 24 | ProgressServlet 25 | lz.xawl.File.servlet.ProgressServlet 26 | 27 | 28 | This is the description of my J2EE component 29 | This is the display name of my J2EE component 30 | UploadServlet 31 | lz.xawl.File.servlet.UploadServlet 32 | 33 | 34 | CatalogServlet 35 | /CatalogServlet 36 | 37 | 38 | DownLoadServlet 39 | /DownLoadServlet 40 | 41 | 42 | FileServlet 43 | /FileServlet 44 | 45 | 46 | ProgressServlet 47 | /ProgressServlet 48 | 49 | 50 | UploadServlet 51 | /UploadServlet 52 | 53 | 54 | index.jsp 55 | 56 | -------------------------------------------------------------------------------- /mydisks/WebRoot/css/remodal-default-theme.css: -------------------------------------------------------------------------------- 1 | /* ========================================================================== 2 | Remodal's default mobile first theme 3 | ========================================================================== */ 4 | 5 | /* Default theme styles for the background */ 6 | 7 | .remodal-bg.remodal-is-opening, 8 | .remodal-bg.remodal-is-opened { 9 | filter: blur(3px); 10 | } 11 | 12 | 13 | /* Default theme styles of the overlay */ 14 | 15 | .remodal-overlay { 16 | background: rgba(43, 46, 56, 0.9); 17 | } 18 | 19 | .remodal-overlay.remodal-is-opening, 20 | .remodal-overlay.remodal-is-closing { 21 | animation-fill-mode: forwards; 22 | } 23 | 24 | .remodal-overlay.remodal-is-opening { 25 | animation: remodal-overlay-opening-keyframes 0.3s; 26 | } 27 | 28 | .remodal-overlay.remodal-is-closing { 29 | animation: remodal-overlay-closing-keyframes 0.3s; 30 | } 31 | 32 | /* Default theme styles of the wrapper */ 33 | 34 | .remodal-wrapper { 35 | padding: 10px 10px 0; 36 | } 37 | 38 | /* Default theme styles of the modal dialog */ 39 | 40 | .remodal { 41 | box-sizing: border-box; 42 | width: 100%; 43 | margin-bottom: 10px; 44 | padding: 35px; 45 | 46 | transform: translate3d(0, 0, 0); 47 | 48 | color: #2b2e38; 49 | background: #fff; 50 | } 51 | 52 | .remodal.remodal-is-opening, 53 | .remodal.remodal-is-closing { 54 | animation-fill-mode: forwards; 55 | } 56 | 57 | .remodal.remodal-is-opening { 58 | animation: remodal-opening-keyframes 0.3s; 59 | } 60 | 61 | .remodal.remodal-is-closing { 62 | animation: remodal-closing-keyframes 0.3s; 63 | } 64 | 65 | /* Vertical align of the modal dialog */ 66 | 67 | .remodal, 68 | .remodal-wrapper:after { 69 | vertical-align: middle; 70 | } 71 | 72 | /* Close button */ 73 | 74 | .remodal-close { 75 | position: absolute; 76 | top: 0; 77 | right: 0; 78 | 79 | display: block; 80 | overflow: visible; 81 | 82 | width: 35px; 83 | height: 35px; 84 | margin: 0; 85 | padding: 0; 86 | 87 | cursor: pointer; 88 | transition: color 0.2s; 89 | text-decoration: none; 90 | 91 | color: #95979c; 92 | border: 0; 93 | outline: 0; 94 | background: transparent; 95 | } 96 | 97 | .remodal-close:hover, 98 | .remodal-close:focus { 99 | color: #2b2e38; 100 | } 101 | 102 | .remodal-close:before { 103 | font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important; 104 | font-size: 25px; 105 | line-height: 35px; 106 | 107 | position: absolute; 108 | top: 0; 109 | left: 0; 110 | 111 | display: block; 112 | 113 | width: 35px; 114 | 115 | content: "\00d7"; 116 | text-align: center; 117 | } 118 | 119 | /* Dialog buttons */ 120 | 121 | .remodal-confirm, 122 | .remodal-cancel { 123 | font: inherit; 124 | 125 | display: inline-block; 126 | overflow: visible; 127 | 128 | min-width: 110px; 129 | margin: 0; 130 | padding: 12px 0; 131 | 132 | cursor: pointer; 133 | transition: background 0.2s; 134 | text-align: center; 135 | vertical-align: middle; 136 | text-decoration: none; 137 | 138 | border: 0; 139 | outline: 0; 140 | } 141 | 142 | .remodal-confirm { 143 | color: #fff; 144 | background: #0275D8; 145 | } 146 | 147 | .remodal-confirm:hover, 148 | .remodal-confirm:focus { 149 | background:#51A8FF; 150 | } 151 | 152 | .remodal-cancel { 153 | color: #fff; 154 | background: #e57373; 155 | } 156 | 157 | .remodal-cancel:hover, 158 | .remodal-cancel:focus { 159 | background: #ef5350; 160 | } 161 | 162 | /* Remove inner padding and border in Firefox 4+ for the button tag. */ 163 | 164 | .remodal-confirm::-moz-focus-inner, 165 | .remodal-cancel::-moz-focus-inner, 166 | .remodal-close::-moz-focus-inner { 167 | padding: 0; 168 | 169 | border: 0; 170 | } 171 | 172 | /* Keyframes 173 | ========================================================================== */ 174 | 175 | @keyframes remodal-opening-keyframes { 176 | from { 177 | transform: scale(1.05); 178 | 179 | opacity: 0; 180 | } 181 | to { 182 | transform: none; 183 | 184 | opacity: 1; 185 | } 186 | } 187 | 188 | @keyframes remodal-closing-keyframes { 189 | from { 190 | transform: scale(1); 191 | 192 | opacity: 1; 193 | } 194 | to { 195 | transform: scale(0.95); 196 | 197 | opacity: 0; 198 | } 199 | } 200 | 201 | @keyframes remodal-overlay-opening-keyframes { 202 | from { 203 | opacity: 0; 204 | } 205 | to { 206 | opacity: 1; 207 | } 208 | } 209 | 210 | @keyframes remodal-overlay-closing-keyframes { 211 | from { 212 | opacity: 1; 213 | } 214 | to { 215 | opacity: 0; 216 | } 217 | } 218 | 219 | /* Media queries 220 | ========================================================================== */ 221 | 222 | @media only screen and (min-width: 641px) { 223 | .remodal { 224 | max-width: 700px; 225 | } 226 | } 227 | 228 | /* IE8 229 | ========================================================================== */ 230 | 231 | .lt-ie9 .remodal-overlay { 232 | background: #2b2e38; 233 | } 234 | 235 | .lt-ie9 .remodal { 236 | width: 700px; 237 | } 238 | -------------------------------------------------------------------------------- /mydisks/WebRoot/css/remodal.css: -------------------------------------------------------------------------------- 1 | /* ========================================================================== 2 | Remodal's necessary styles 3 | ========================================================================== */ 4 | 5 | /* Hide scroll bar */ 6 | 7 | html.remodal-is-locked { 8 | overflow: hidden; 9 | } 10 | 11 | /* Anti FOUC */ 12 | 13 | .remodal, 14 | [data-remodal-id] { 15 | display: none; 16 | } 17 | 18 | /* Necessary styles of the overlay */ 19 | 20 | .remodal-overlay { 21 | position: fixed; 22 | z-index: 9999; 23 | top: -5000px; 24 | right: -5000px; 25 | bottom: -5000px; 26 | left: -5000px; 27 | 28 | display: none; 29 | } 30 | 31 | /* Necessary styles of the wrapper */ 32 | 33 | .remodal-wrapper { 34 | position: fixed; 35 | z-index: 10000; 36 | top: 0; 37 | right: 0; 38 | bottom: 0; 39 | left: 0; 40 | 41 | display: none; 42 | overflow: auto; 43 | 44 | text-align: center; 45 | 46 | -webkit-overflow-scrolling: touch; 47 | } 48 | 49 | .remodal-wrapper:after { 50 | display: inline-block; 51 | 52 | height: 100%; 53 | margin-left: -0.05em; 54 | 55 | content: ""; 56 | } 57 | 58 | /* Fix iPad, iPhone glitches */ 59 | 60 | .remodal-overlay, 61 | .remodal-wrapper { 62 | backface-visibility: hidden; 63 | } 64 | 65 | /* Necessary styles of the modal dialog */ 66 | 67 | .remodal { 68 | position: relative; 69 | 70 | outline: none; 71 | 72 | text-size-adjust: 100%; 73 | } 74 | 75 | .remodal-is-initialized { 76 | /* Disable Anti-FOUC */ 77 | display: inline-block; 78 | } 79 | -------------------------------------------------------------------------------- /mydisks/WebRoot/css/reset.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin:0 auto; 3 | padding:0; 4 | min-width:1024px; 5 | } 6 | #all a{ 7 | text-decoration:none; 8 | outline: none; 9 | hide-focus: expression(this.hideFocus=true); 10 | } 11 | #all a:hover{ 12 | color:#0060BF; 13 | } 14 | .top{ 15 | position:relative; 16 | } 17 | .navbar-brand img{ 18 | height:30px; 19 | float:left; 20 | } 21 | .navbar-brand p{ 22 | float:right; 23 | margin-bottom: 0rem; 24 | margin-left:10px; 25 | } 26 | .nav li{ 27 | padding-right:30px; 28 | } 29 | .top .navbar { 30 | border-radius: 0rem; 31 | } 32 | .nav_width{ 33 | margin:0 auto; 34 | } 35 | .nav_width p{ 36 | font-famliy:"微软雅黑"; 37 | font-size:20px; 38 | font-weight:600; 39 | } 40 | .login label{ 41 | display:block; 42 | } 43 | .login{ 44 | position: absolute; 45 | z-index: 1000; 46 | width:300px; 47 | top:20%; 48 | right:15%; 49 | background-color:#fff; 50 | padding:30px; 51 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.13), 0px 1px 5px rgba(0, 0, 0, 0.36), 0px 0px 0px 1px rgba(255, 255, 255, 0.69) inset; 52 | } 53 | .login_in{ 54 | margin:0 auto; 55 | text-align:left; 56 | } 57 | .login_in p{ 58 | color:#0275D8; 59 | } 60 | #fault{ 61 | width:200px; 62 | height:16px; 63 | background-image:url(../images/falut.png); 64 | background-repeat:no-repeat; 65 | display:none; 66 | } 67 | .alerterro { 68 | height:16px; 69 | margin:6px 0; 70 | } 71 | 72 | .alerterro span{ 73 | padding-left:25px; 74 | font-size:14px; 75 | color:#666; 76 | font-style:normal; 77 | } 78 | .btn{ 79 | width:220px; 80 | } 81 | .verification input{ 82 | width:125px; 83 | margin-right:15px; 84 | float:left; 85 | } 86 | .verification img{ 87 | width:90px; 88 | height:35px; 89 | float:right; 90 | } 91 | .middle{ 92 | max-width:1100px; 93 | margin:0 auto; 94 | margin-bottom:40px; 95 | } 96 | .middle_nav{ 97 | width:200px; 98 | height:35px; 99 | margin:30px 0 30px 0; 100 | font-size:20px; 101 | font-family:"微软雅黑"; 102 | background-image:url(../images/navback.jpg); 103 | background-repeat:no-repeat; 104 | } 105 | .mid_title { 106 | text-align:center; 107 | margin:0 auto; 108 | 109 | } 110 | .mid_title p{ 111 | font-size:20px; 112 | color:#474775; 113 | font-family:"微软雅黑"; 114 | font-weight:600; 115 | } 116 | .footer{ 117 | margin-top:20px; 118 | font-size:14px; 119 | text-align:center; 120 | color:#999; 121 | } 122 | .rborder{ 123 | border:1px solid #fff; 124 | border-right-color:#ccc; 125 | } 126 | 127 | 128 | #main-nav { 129 | background-color:#F5F5F5; 130 | padding:20px 15px 0 15px; 131 | min-height:650px; 132 | } 133 | 134 | #main-nav li{ 135 | padding:10px; 136 | text-align:center; 137 | 138 | } 139 | #main-nav li a{ 140 | color:#333333; 141 | } 142 | .nav-tabs { 143 | border:none; 144 | } 145 | .rightarea{ 146 | padding:20px; 147 | min-height:650px; 148 | border:1px solid #F0F0F0; 149 | box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.13), 0px 0px 0px rgba(0, 0, 0, 0.36), 0px 0px 0px 0px rgba(255, 255, 255, 0.69) inset; 150 | } 151 | .rightarea button{ 152 | width:100px; 153 | } 154 | .righthead{ 155 | margin-bottom:10px; 156 | } 157 | .searchf p{ 158 | float:left; 159 | } 160 | .searchf .input-group{ 161 | width:260px; 162 | margin-bottom:20px; 163 | float:right; 164 | } 165 | .table tr:hover{ 166 | background-color:#F7F9FD; 167 | } 168 | .table th, .table td { 169 | padding: 0.5rem; 170 | } 171 | .admin{ 172 | margin-top:28px; 173 | padding:0px 20px; 174 | text-align:center; 175 | } 176 | .admin p{ 177 | margin:10px; 178 | } 179 | .admin img{ 180 | width:110px; 181 | height:110px; 182 | border:1px solid #999; 183 | } 184 | .admin a{ 185 | color:#333; 186 | } 187 | .admin .table a:focus, a:hover{ 188 | color:#0080FF; 189 | } 190 | .admin i{ 191 | padding-right:20px; 192 | } 193 | .filefound{ 194 | box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.13), 0px 0px 0px rgba(0, 0, 0, 0.36), 0px 0px 0px 0px rgba(255, 255, 255, 0.69) inset; 195 | max-width:1100px; 196 | min-height:600px; 197 | margin-top:20px; 198 | margin-left:20px; 199 | margin-right:50px; 200 | padding:30px; 201 | } 202 | .filefound button { 203 | width:130px; 204 | } 205 | .found{ 206 | box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.13), 0px 0px 0px rgba(0, 0, 0, 0.36), 0px 0px 0px 0px rgba(255, 255, 255, 0.69) inset; 207 | max-width:1100px; 208 | min-height:600px; 209 | margin-top:20px; 210 | margin-left:20px; 211 | margin-right:50px; 212 | } 213 | .found img{ 214 | margin-top:200px; 215 | vertical-align:central; 216 | } 217 | .ftitle{ 218 | float:left; 219 | margin:30px 0 0 30px; 220 | color:#333; 221 | } 222 | .found i{ 223 | margin-right:10px; 224 | } 225 | .found p{ 226 | text-align:center; 227 | } 228 | .found .btn{ 229 | width:100px; 230 | float:right; 231 | margin:20px 20px; 232 | } 233 | .size{ 234 | font-size:14px; 235 | color:#999; 236 | margin-top:20px; 237 | } 238 | .sign_middle { 239 | max-width:1000px; 240 | margin:0 auto; 241 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.13), 0px 0px 0px rgba(0, 0, 0, 0.36), 0px 0px 0px 0px rgba(255, 255, 255, 0.69) inset; 242 | min-height:600px; 243 | } 244 | .signtitle { 245 | background-image: url(../images/sign.jpg); 246 | background-repeat: no-repeat; 247 | height:40px; 248 | margin:30px 0 30px 30px; 249 | text-align:right; 250 | } 251 | .inputlist{ 252 | margin-left:50px; 253 | } 254 | 255 | .sign_middle .input-group input{ 256 | width:350px; 257 | float:right; 258 | margin:15px; 259 | } 260 | .inputlist .input-group .btn{ 261 | margin-top:40px; 262 | margin-left:85px; 263 | width:250px; 264 | } 265 | .sign_middle p{ 266 | float:right; 267 | font-size:14px; 268 | color:#666; 269 | margin:20px; 270 | } 271 | .sign_middle .proof input{ 272 | width:150px; 273 | float:right; 274 | } 275 | .sign_middle .proof img{ 276 | float:right; 277 | margin:15px; 278 | height:38px; 279 | } 280 | .sign_middle .proof a{ 281 | float:right; 282 | margin:15px; 283 | } 284 | .sign_middle label{ 285 | width:50px; 286 | text-align:right; 287 | float:left; 288 | line-height:60px; 289 | } 290 | .sign_middle .btn-lg, .btn-group-lg > .btn{ 291 | padding: 0.4rem 1rem; 292 | } 293 | .sign_middle button{ 294 | margin:40px 170px; 295 | } 296 | .signsucess{ 297 | width:400px; 298 | margin:0 auto; 299 | margin-top:200px; 300 | } 301 | .signsucess img{ 302 | width:80px; 303 | float:left; 304 | margin-right:20px; 305 | } 306 | .signsucess h3{ 307 | padding-top:15px; 308 | font-family:"微软雅黑"; 309 | } 310 | .remodal-bg{ 311 | display:block; 312 | float:right; 313 | margin-top:23px; 314 | margin-right:25px; 315 | } 316 | .fmall{ 317 | margin:0 auto; 318 | } 319 | .fmtable{ 320 | margin-top:20px; 321 | } 322 | .fmlist{ 323 | margin:0 20px; 324 | 325 | } 326 | .fmadmin img{ 327 | border:1px solid #999; 328 | margin-top:20px; 329 | margin-left:20px; 330 | } 331 | .fmlist p{ 332 | line-height:16px; 333 | margin-bottom:0px; 334 | } 335 | .fmlist a img{ 336 | margin-right:15px; 337 | } 338 | .fmlist .dropdown { 339 | display:inline; 340 | } 341 | .fmlist .dropdown-menu{ 342 | min-width:100px; 343 | } 344 | .fmlist .dropdown li{ 345 | padding-left:20px; 346 | } 347 | .fp p{ 348 | line-height:16px; 349 | margin-bottom:0px; 350 | margin-top:7px; 351 | } 352 | .fp a{ 353 | margin-right:20px; 354 | } 355 | .exe{ 356 | background-image:url(../images/exe.jpg); 357 | background-repeat:no-repeat; 358 | padding-left:30px; 359 | } 360 | .jpg{ 361 | background-image:url(../images/jepg.jpg); 362 | background-repeat:no-repeat; 363 | padding-left:30px; 364 | } 365 | .apk{ 366 | background-image:url(../images/apk.jpg); 367 | background-repeat:no-repeat; 368 | padding-left:30px; 369 | } 370 | .mp3{ 371 | background-image:url(../images/music.jpg); 372 | background-repeat:no-repeat; 373 | padding-left:30px; 374 | } 375 | .zip{ 376 | background-image:url(../images/zip.jpg); 377 | background-repeat:no-repeat; 378 | padding-left:30px; 379 | } 380 | .others{ 381 | background-image:url(../images/others.jpg); 382 | background-repeat:no-repeat; 383 | padding-left:30px; 384 | } 385 | .mp4{ 386 | background-image:url(../images/video.jpg); 387 | background-repeat:no-repeat; 388 | padding-left:30px; 389 | } 390 | .fmback{ 391 | max-width:1100px; 392 | background-image:url(../images/back1.jpg); 393 | padding-left:50px; 394 | } 395 | .fmtable .table a{ 396 | color:#333; 397 | } 398 | .fmtable .table td{ 399 | width:20px; 400 | } 401 | .fmlist .table td{ 402 | padding:0.8em; 403 | } 404 | .fmlist .table a{ 405 | color:#333; 406 | } 407 | #fmtable .table-hover tbody tr:hover { 408 | background-color: #F0F0F0; 409 | } 410 | #fmtable td{ 411 | border:none; 412 | line-height:0.5em; 413 | } 414 | #fmtable p{ 415 | padding-top:25px; 416 | } 417 | #fmtable table{ 418 | width:250px; 419 | margin-top:15px; 420 | margin-left:-10px; 421 | } 422 | .fmreback{ 423 | background-image:url(../images/reback1.jpg); 424 | background-repeat:repeat-x; 425 | } 426 | .fmtime{ 427 | text-align:center; 428 | } 429 | .filefound .form-inline{ 430 | width:600px; 431 | margin:0 auto; 432 | margin-top:200px; 433 | } 434 | .myprogress { 435 | width:600px; 436 | margin:0px 0 20px 0; 437 | } 438 | .myprogress .progress{ 439 | width:500px; 440 | float:left; 441 | } 442 | .myprogress .myprogress_text{ 443 | float:right; 444 | line-height:15px; 445 | } -------------------------------------------------------------------------------- /mydisks/WebRoot/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /mydisks/WebRoot/fonts/glyphicons-halflings-regular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | -------------------------------------------------------------------------------- /mydisks/WebRoot/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /mydisks/WebRoot/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /mydisks/WebRoot/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /mydisks/WebRoot/home.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 5 | <% 6 | String path = request.getContextPath(); 7 | String basePath = request.getScheme() + "://" 8 | + request.getServerName() + ":" + request.getServerPort() 9 | + path + "/"; 10 | %> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 信息工程学院网盘 20 | 21 | 22 | 23 | 24 | 25 | 72 | 73 |
74 | 75 |
76 | 98 |
99 |
100 |
101 |
102 |
103 |
104 | 105 |

${sessionScope.session_user.username}

106 | 107 | 108 | 109 | 110 | 111 |
分享订阅粉丝
${sessionScope.session_user.shareCount }${sessionScope.session_user.followcount }${sessionScope.session_user.follower}
112 |
113 |
114 |
115 | 116 |
117 |
118 |

我的文件

119 | 125 | 126 | 127 | 128 |
129 | 135 |

136 | 140 |
141 | 我的文件>> 142 | 143 | ${p.name}>> 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 |
文件名修改日期大小类型下载次数操作
对不起,没有文件了
${c.cName }${c.cDate }删除重命名
${f.fName }${f.fUploadtime }MB${f.fType }${f.fDowncount }删除重命名 下载
197 |
198 |
199 |
200 |
201 |
202 |
203 | 204 | 205 | 208 | 209 | 210 | 211 | 212 | 367 | 372 | -------------------------------------------------------------------------------- /mydisks/WebRoot/images/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/01.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/02.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/03.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/04.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/1024.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/apk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/apk.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/back1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/back1.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/banner1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/banner1.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/banner2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/banner2.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/check.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/down.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/exe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/exe.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/falut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/falut.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/folder.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/jepg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/jepg.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/logo1.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/logo_small.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/more.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/music.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/music.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/navback.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/navback.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/notfound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/notfound.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/others.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/others.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/reback1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/reback1.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/save.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/sign-check-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/sign-check-icon.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/sign.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/sign.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/spare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/spare.png -------------------------------------------------------------------------------- /mydisks/WebRoot/images/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/user.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/video.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/video.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/welcome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/welcome.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/yz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/yz.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/images/zip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VinceLz/disk/fe01b2a7cd15c2a2f8ee572f744d8591c1659163/mydisks/WebRoot/images/zip.jpg -------------------------------------------------------------------------------- /mydisks/WebRoot/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 3 | 4 | -------------------------------------------------------------------------------- /mydisks/WebRoot/js/login.js: -------------------------------------------------------------------------------- 1 | function aCheck1(){ 2 | document.getElementById("span1").style.display="block"; 3 | 4 | } 5 | function bCheck2(){ 6 | document.getElementById("span2").style.display="block"; 7 | } 8 | function cCheck3(){ 9 | document.getElementById("span3").style.display="block"; 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /mydisks/src/c3p0-config.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | jdbc:mysql://localhost:3306/drive?useUnicode=true&characterEncoding=UTF8 7 | com.mysql.jdbc.Driver 8 | root 9 | zhen1314 10 | 11 | 3 12 | 10 13 | 2 14 | 10 15 | 16 | 17 | 18 | 19 | jdbc:mysql://localhost:3306/mydb1 20 | com.mysql.jdbc.Driver 21 | root 22 | 123 23 | 3 24 | 10 25 | 2 26 | 10 27 | 28 | 29 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/Catalog/dao/CatalogDao.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.Catalog.dao; 2 | 3 | import java.sql.SQLException; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import javax.servlet.ServletContext; 9 | 10 | import lz.xawl.Catalog.domain.Catalog; 11 | import lz.xawl.File.dao.FileDao; 12 | import lz.xawl.File.domain.File; 13 | 14 | import org.apache.commons.dbutils.QueryRunner; 15 | import org.apache.commons.dbutils.handlers.BeanHandler; 16 | import org.apache.commons.dbutils.handlers.MapHandler; 17 | import org.apache.commons.dbutils.handlers.MapListHandler; 18 | import org.apache.commons.dbutils.handlers.ScalarHandler; 19 | 20 | import cn.itcast.commons.CommonUtils; 21 | import cn.itcast.jdbc.TxQueryRunner; 22 | 23 | public class CatalogDao { 24 | private QueryRunner qr = new TxQueryRunner(); 25 | private FileDao fileDao = new FileDao(); 26 | 27 | // 给我一个cid,就可以查找下面一级的目录和文件 28 | public Catalog findByCidToCatalog(String cid) throws SQLException { 29 | String sql = "select * from catalog where cId=?"; 30 | Map beanMap = qr.query(sql, new MapHandler(), cid); 31 | Catalog catalog = CommonUtils.toBean(beanMap, Catalog.class); 32 | // 还有pid cF 这个属性就行映射 33 | if (beanMap.get("pId") != null) { 34 | // 这不是最顶层目录 需要封装他的父级目录 只有pid 35 | Catalog c = new Catalog(); 36 | c.setcId((String) beanMap.get("pId")); 37 | catalog.setParent(c); 38 | } 39 | sql = "select * from catalog where pId=?"; 40 | List> beanMapList = qr.query(sql, 41 | new MapListHandler(), catalog.getcId()); 42 | 43 | List cataList = this.listToBean(beanMapList); 44 | 45 | catalog.setChildren(cataList); 46 | // 开始封装catalog 的子文件 47 | 48 | String cf = (String) beanMap.get("cF"); 49 | List myfile = fileDao.findByCf(cf); 50 | catalog.setMyFile(myfile); 51 | return catalog; 52 | } 53 | 54 | // 给我一个list map 集合 我帮你转换成 list bean map-bean 55 | public List listToBean(List> map) { 56 | List toList = new ArrayList(); 57 | for (Map mymap : map) { 58 | Catalog c = CommonUtils.toBean(mymap, Catalog.class); 59 | if (mymap.get("pId") != null) { 60 | Catalog c1 = new Catalog(); 61 | c1.setcId((String) mymap.get("pId")); 62 | c.setParent(c1); 63 | } 64 | toList.add(c); 65 | } 66 | return toList; 67 | } 68 | 69 | // 通过cid 你bean 一个对象 70 | 71 | public Catalog findByCid(String cid) throws SQLException { 72 | String sql = "select * from catalog where cId=?"; 73 | return qr.query(sql, new BeanHandler(Catalog.class), cid); 74 | } 75 | 76 | public void createCatalog(Catalog c) throws SQLException { 77 | String sql = "insert into catalog (cId,pId,cName,cDate,isShare) values(?,?,?,?,?)"; 78 | Object[] para = { c.getcId(), c.getParent().getcId(), c.getcName(), 79 | c.getcDate(), c.getIsShare() }; 80 | qr.update(sql, para); 81 | 82 | } 83 | 84 | // 通过cid 找到cf值 85 | public String cidTocf(String cid) throws SQLException { 86 | String sql = "select cf from catalog where cId=?"; 87 | return (String) qr.query(sql, new ScalarHandler(), cid); 88 | } 89 | 90 | // 写入cf值 91 | 92 | public void intoCf(String cid, String cf) throws SQLException { 93 | String sql = "update catalog set cF=? where cId=?"; 94 | qr.update(sql, cf, cid); 95 | } 96 | 97 | /* 98 | * 给cid 删除他后面所有的文件和文件夹 需要遍历数 递归 99 | */ 100 | public void deleteByCatalog(String cid, ServletContext context) 101 | throws SQLException { 102 | 103 | Catalog cata = this.findByCidToCatalog(cid); 104 | 105 | // 先删除该目录下的文件 106 | if (cata.getMyFile() != null) { 107 | 108 | System.out.println("开始删除纯文件"); 109 | fileDao.removeAll(cata.getMyFile(), context); 110 | // 还要删除本地文件 111 | } 112 | 113 | String sql = "select cF from catalog where cId=?"; 114 | String cf = (String) qr.query(sql, new ScalarHandler(), cata.getcId()); 115 | sql = "delete from catalog_file where cf=?"; 116 | qr.update(sql, cf); 117 | 118 | sql = "delete from catalog where cId=?"; 119 | qr.update(sql, cata.getcId()); 120 | List chileList = cata.getChildren(); 121 | 122 | for (Catalog c : chileList) { 123 | deleteByCatalog(c.getcId(), context); 124 | } 125 | 126 | return; 127 | } 128 | 129 | public void testDelete() throws Exception { 130 | 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/Catalog/domain/Catalog.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.Catalog.domain; 2 | 3 | import java.util.List; 4 | 5 | import lz.xawl.File.domain.File; 6 | 7 | public class Catalog { 8 | 9 | private String cId; // 对应 10 | private String cName; // 对应 11 | private String cDate; // 对应 12 | private Catalog parent; 13 | private String isShare; // 对应 14 | private List children; 15 | private List myFile; 16 | 17 | @Override 18 | public String toString() { 19 | return "Catalog [cId=" + cId + ", cName=" + cName + ", cDate=" + cDate 20 | + ", parent=" + parent + ", isShare=" + isShare + ", children=" 21 | + children + ", myFile=" + myFile + "]"; 22 | } 23 | 24 | public String getIsShare() { 25 | return isShare; 26 | } 27 | 28 | public void setIsShare(String isShare) { 29 | this.isShare = isShare; 30 | } 31 | 32 | public String getcId() { 33 | return cId; 34 | } 35 | 36 | public void setcId(String cId) { 37 | this.cId = cId; 38 | } 39 | 40 | public String getcName() { 41 | return cName; 42 | } 43 | 44 | public void setcName(String cName) { 45 | this.cName = cName; 46 | } 47 | 48 | public String getcDate() { 49 | return cDate; 50 | } 51 | 52 | public void setcDate(String cDate) { 53 | this.cDate = cDate; 54 | } 55 | 56 | public Catalog getParent() { 57 | return parent; 58 | } 59 | 60 | public void setParent(Catalog parent) { 61 | this.parent = parent; 62 | } 63 | 64 | public List getChildren() { 65 | return children; 66 | } 67 | 68 | public void setChildren(List children) { 69 | this.children = children; 70 | } 71 | 72 | public List getMyFile() { 73 | return myFile; 74 | } 75 | 76 | public void setMyFile(List myFile) { 77 | this.myFile = myFile; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/Catalog/service/CatalogService.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.Catalog.service; 2 | 3 | import java.sql.SQLException; 4 | 5 | import javax.servlet.ServletContext; 6 | 7 | import lz.xawl.Catalog.dao.CatalogDao; 8 | import lz.xawl.Catalog.domain.Catalog; 9 | 10 | public class CatalogService { 11 | private CatalogDao cDao = new CatalogDao(); 12 | 13 | // 拿cid去查找他下面的一级文件夹已经文件 14 | public Catalog findByCidToCatalog(String cid) { 15 | 16 | try { 17 | return cDao.findByCidToCatalog(cid); 18 | } catch (SQLException e) { 19 | throw new RuntimeException(e); 20 | } 21 | 22 | } 23 | 24 | // 通过cid 封装catalog 25 | public Catalog findByCid(String cid) { 26 | try { 27 | return cDao.findByCid(cid); 28 | } catch (SQLException e) { 29 | throw new RuntimeException(e); 30 | } 31 | } 32 | 33 | public void createCatalog(Catalog c) { 34 | try { 35 | cDao.createCatalog(c); 36 | } catch (SQLException e) { 37 | throw new RuntimeException(e); 38 | } 39 | } 40 | 41 | public String cidTocf(String cid) { 42 | try { 43 | return cDao.cidTocf(cid); 44 | } catch (SQLException e) { 45 | throw new RuntimeException(e); 46 | } 47 | } 48 | 49 | public void intoCf(String cid, String cf) { 50 | try { 51 | cDao.intoCf(cid, cf); 52 | } catch (SQLException e) { 53 | throw new RuntimeException(e); 54 | } 55 | } 56 | 57 | public void deleteByCatalog(String cid, ServletContext context) { 58 | try { 59 | cDao.deleteByCatalog(cid, context); 60 | } catch (SQLException e) { 61 | throw new RuntimeException(e); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/Catalog/servlet/CatalogServlet.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.Catalog.servlet; 2 | 3 | import java.io.IOException; 4 | import java.net.URLEncoder; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | import java.util.List; 8 | 9 | import javax.servlet.ServletException; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | import lz.xawl.Catalog.domain.Catalog; 14 | import lz.xawl.Catalog.service.CatalogService; 15 | import lz.xawl.File.domain.File; 16 | import lz.xawl.Util.Tool; 17 | import cn.itcast.servlet.BaseServlet; 18 | 19 | public class CatalogServlet extends BaseServlet { 20 | private CatalogService service = new CatalogService(); 21 | 22 | public String myCatalog(HttpServletRequest request, 23 | HttpServletResponse response) throws ServletException, IOException { 24 | 25 | String cid = request.getParameter("cid"); 26 | if (cid == null || cid.isEmpty()) { 27 | cid = "1"; 28 | } 29 | Catalog c = service.findByCidToCatalog(cid); 30 | request.setAttribute("catalog", c); 31 | return "f:/home.jsp"; 32 | } 33 | 34 | // 创建文件夹 35 | public String createCatalog(HttpServletRequest request, 36 | HttpServletResponse response) throws ServletException, IOException { 37 | response.setCharacterEncoding("utf-8"); 38 | request.setCharacterEncoding("utf-8"); 39 | String cid = request.getParameter("cid");// 拿到他的父cid 40 | 41 | String cName = request.getParameter("name"); 42 | cName = java.net.URLDecoder.decode(cName, "UTF-8"); 43 | 44 | Catalog parent = service.findByCid(cid); 45 | Catalog c = new Catalog(); 46 | // 开始封装文件夹的信息 47 | c.setcId(Tool.randomId()); 48 | c.setParent(parent); 49 | c.setcName(cName); 50 | SimpleDateFormat simp = new SimpleDateFormat("yyyy-MM-dd"); 51 | String newTime = simp.format(new Date()).toString(); 52 | c.setcDate(newTime); 53 | c.setIsShare("0"); 54 | service.createCatalog(c); 55 | // 然后在转发到当前目录下 56 | /* 57 | * 这有2种方案,1 是用ajax创建文件夹 2是用servlet创建 先用2 , 58 | */ 59 | return "r:/CatalogServlet?method=myCatalog&cid=" + cid; 60 | } 61 | 62 | public String deleteCatalog(HttpServletRequest request, 63 | HttpServletResponse response) throws ServletException, IOException { 64 | String cid = request.getParameter("cid"); 65 | String pid = request.getParameter("pid"); 66 | service.deleteByCatalog(cid, this.getServletContext()); 67 | return "r:/CatalogServlet?method=myCatalog&cid=" + pid; 68 | 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/dao/FileDao.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.dao; 2 | 3 | import java.sql.SQLException; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import javax.servlet.ServletContext; 9 | 10 | import lz.xawl.File.domain.File; 11 | 12 | import org.apache.commons.dbutils.QueryRunner; 13 | import org.apache.commons.dbutils.handlers.BeanHandler; 14 | import org.apache.commons.dbutils.handlers.MapListHandler; 15 | 16 | import cn.itcast.jdbc.TxQueryRunner; 17 | 18 | public class FileDao { 19 | 20 | private QueryRunner qr = new TxQueryRunner(); 21 | 22 | /* 23 | * 给一个cf,就可以帮你把所有的文件打包起来 24 | */ 25 | public List findByCf(String cf) throws SQLException { 26 | String sql = "select * from catalog_file where cf=?"; 27 | List> result = qr.query(sql, new MapListHandler(), 28 | cf); 29 | List myfile = new ArrayList(); 30 | for (Map map : result) { 31 | String sql2 = "select * from file where fId=?"; 32 | File f = qr.query(sql2, new BeanHandler(File.class), 33 | (String) map.get("fId").toString()); 34 | 35 | myfile.add(f); 36 | } 37 | return myfile; 38 | } 39 | 40 | /* 41 | * 给一个fid 帮你把文件打包出来 暂时没有封装 user 42 | */ 43 | public File findByFid(String fid) throws SQLException { 44 | String sql = "select * from file where fId=?"; 45 | return qr.query(sql, new BeanHandler(File.class), fid); 46 | } 47 | 48 | // 上传完后保存文件信息 49 | public void upLoadFile(File file) throws SQLException { 50 | String sql = "insert into file (fId,fPath,fSize,fType,fName,fHash,fDowncount,fDesc,fUploadtime,isShare,cid,fDiskName) values(?,?,?,?,?,?,?,?,?,?,?,?)"; 51 | Object[] param = { file.getfId(), file.getfPath(), file.getfSize(), 52 | file.getfType(), file.getfName(), file.getfHash(), 53 | file.getfDowncount(), file.getfDesc(), file.getfUploadtime(), 54 | file.getIsShare(), file.getCatalog().getcId(), 55 | file.getfDiskName() }; 56 | qr.update(sql, param); 57 | } 58 | 59 | // cf写入 60 | public void writecf(String fid, String cf) throws SQLException { 61 | String sql = "insert into catalog_file values(?,?)"; 62 | qr.update(sql, cf, fid); 63 | } 64 | 65 | // 删除文件 ajax做吧 66 | public boolean deleteByFid(String fid) throws SQLException { 67 | 68 | String sql = "delete from file where fId=?"; 69 | Boolean b = qr.update(sql, fid) == 0 ? false : true; 70 | sql = "delete from catalog_file where fid=?"; 71 | Boolean a = qr.update(sql, fid) == 0 ? false : true; 72 | return a && b; 73 | } 74 | 75 | // 修改文件信息 76 | public void editFile(String count, String fid) throws SQLException { 77 | String sql = "update file set fDowncount=? where fId=?"; 78 | qr.update(sql, count, fid); 79 | } 80 | 81 | /* 82 | * 批量删除纯文件 83 | */ 84 | public void removeAll(List myfile, ServletContext context) 85 | throws SQLException { 86 | String sql = "delete from file where fId=?"; 87 | for (File f : myfile) { 88 | 89 | qr.update(sql, f.getfId()); 90 | java.io.File abf = new java.io.File(context.getRealPath(f 91 | .getfPath().substring(8))); 92 | abf.delete(); 93 | } 94 | } 95 | //查找fpath 96 | public File findByFpath(String path) throws SQLException{ 97 | String sql="select * from file where fPath=?"; 98 | return qr.query(sql, new BeanHandler(File.class),path); 99 | } 100 | 101 | //查找hash 102 | public File findByHash(String hash) throws SQLException{ 103 | String sql="select * from file where fHash=?"; 104 | return qr.query(sql, new BeanHandler(File.class),hash); 105 | } 106 | public void test() throws Exception { 107 | File f2 = new File(); 108 | File f1 = new File(); 109 | File f3 = new File(); 110 | f1.setfId("1"); 111 | f2.setfId("2"); 112 | f3.setfId("3"); 113 | List mylist = new ArrayList(); 114 | mylist.add(f1); 115 | mylist.add(f2); 116 | mylist.add(f3); 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/domain/File.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.domain; 2 | 3 | import java.text.DecimalFormat; 4 | 5 | import lz.xawl.Catalog.domain.Catalog; 6 | 7 | public class File{ 8 | private String fId; 9 | private String fPath; 10 | private long fSize; 11 | private String fType; 12 | private String fHash; 13 | private String fDowncount; 14 | private String fDesc; 15 | private String fUploadtime; 16 | private String isShare; 17 | private Catalog catalog; 18 | private String fName; 19 | private String fDiskName; 20 | public String getfDiskName() { 21 | return fDiskName; 22 | } 23 | public void setfDiskName(String fDiskName) { 24 | this.fDiskName = fDiskName; 25 | } 26 | public String getfId() { 27 | return fId; 28 | } 29 | @Override 30 | public String toString() { 31 | return "File [fId=" + fId + ", fPath=" + fPath + ", fName=" + fName 32 | + ", cId=" + "]"; 33 | } 34 | public void setfId(String fId) { 35 | this.fId = fId; 36 | } 37 | public String getfPath() { 38 | return fPath; 39 | } 40 | public void setfPath(String fPath) { 41 | this.fPath = fPath; 42 | } 43 | public String getfName() { 44 | return fName; 45 | } 46 | public void setfName(String fName) { 47 | this.fName = fName; 48 | } 49 | 50 | 51 | public long getfSize() { 52 | return fSize; 53 | } 54 | public void setfSize(long fSize) { 55 | this.fSize = fSize; 56 | } 57 | public String getfType() { 58 | return fType; 59 | } 60 | public void setfType(String fType) { 61 | this.fType = fType; 62 | } 63 | public String getfHash() { 64 | return fHash; 65 | } 66 | public void setfHash(String fHash) { 67 | this.fHash = fHash; 68 | } 69 | public String getfDowncount() { 70 | return fDowncount; 71 | } 72 | public void setfDowncount(String fDowncount) { 73 | this.fDowncount = fDowncount; 74 | } 75 | public String getfDesc() { 76 | return fDesc; 77 | } 78 | public void setfDesc(String fDesc) { 79 | this.fDesc = fDesc; 80 | } 81 | public String getfUploadtime() { 82 | return fUploadtime; 83 | } 84 | public void setfUploadtime(String fUploadtime) { 85 | this.fUploadtime = fUploadtime; 86 | } 87 | public String getIsShare() { 88 | return isShare; 89 | } 90 | public void setIsShare(String isShare) { 91 | this.isShare = isShare; 92 | } 93 | public Catalog getCatalog() { 94 | return catalog; 95 | } 96 | public void setCatalog(Catalog catalog) { 97 | this.catalog = catalog; 98 | } 99 | 100 | 101 | } -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/service/FileService.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.service; 2 | 3 | import java.sql.SQLException; 4 | import java.util.List; 5 | 6 | import lz.xawl.File.dao.FileDao; 7 | import lz.xawl.File.domain.File; 8 | 9 | public class FileService { 10 | private FileDao fileDao=new FileDao(); 11 | 12 | 13 | public List findByCf(String cf) 14 | { 15 | try { 16 | return fileDao.findByCf(cf); 17 | } catch (SQLException e) { 18 | throw new RuntimeException(e); 19 | } 20 | } 21 | 22 | public File findByFid(String fid) 23 | { 24 | try { 25 | return fileDao.findByFid(fid); 26 | } catch (SQLException e) { 27 | throw new RuntimeException(e); 28 | } 29 | } 30 | 31 | 32 | public void upLoadFile(File file) 33 | { 34 | try { 35 | fileDao.upLoadFile(file); 36 | } catch (SQLException e) { 37 | throw new RuntimeException(e); 38 | } 39 | } 40 | 41 | public void writecf(String fid,String cf) 42 | { 43 | try { 44 | fileDao.writecf(fid, cf); 45 | } catch (SQLException e) { 46 | throw new RuntimeException(e); 47 | } 48 | } 49 | 50 | 51 | public Boolean deleteByFid(String fid) 52 | { 53 | try { 54 | return fileDao.deleteByFid(fid); 55 | } catch (SQLException e) { 56 | throw new RuntimeException(e); 57 | } 58 | } 59 | 60 | public File findByHash(String hash) 61 | { 62 | try { 63 | return fileDao.findByHash(hash); 64 | } catch (SQLException e) { 65 | throw new RuntimeException(e); 66 | } 67 | } 68 | 69 | public File findByPath(String path) 70 | { 71 | try { 72 | return fileDao.findByFpath(path); 73 | } catch (SQLException e) { 74 | throw new RuntimeException(e); 75 | } 76 | } 77 | //修改downcount 78 | 79 | public void editcount(String count,String fid) 80 | { 81 | try { 82 | fileDao.editFile(count, fid); 83 | } catch (SQLException e) { 84 | 85 | e.printStackTrace(); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/servlet/DownLoadServlet.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.servlet; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.IOException; 5 | import java.net.URLEncoder; 6 | 7 | import javax.servlet.ServletException; 8 | import javax.servlet.ServletOutputStream; 9 | import javax.servlet.http.HttpServlet; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | import org.apache.commons.io.IOUtils; 14 | 15 | import sun.misc.BASE64Encoder; 16 | 17 | import lz.xawl.File.domain.File; 18 | import lz.xawl.File.service.FileService; 19 | 20 | public class DownLoadServlet extends HttpServlet { 21 | 22 | private FileService fileService = new FileService(); 23 | 24 | @Override 25 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) 26 | throws ServletException, IOException { 27 | 28 | String fid = req.getParameter("fid"); 29 | String cid = req.getParameter("cid"); 30 | File myfile = fileService.findByFid(fid); 31 | String path = this.getServletContext().getRealPath(myfile.getfPath()); 32 | 33 | String framename = filenameEncoding(myfile.getfName(), req); 34 | 35 | String contentType = myfile.getfType();// 通过文件名称获取MIME类型 36 | String contentDisposition = "attachment;filename=" + framename; 37 | // 一个流 38 | FileInputStream input = new FileInputStream(path); 39 | 40 | // 设置头 41 | resp.setHeader("Content-Type", contentType); 42 | resp.setHeader("Content-Disposition", contentDisposition); 43 | resp.setHeader("content-Length", myfile.getfSize() + ""); 44 | // resp.setContentType("application/octet-stream"); 45 | // 获取绑定了响应端的流 46 | ServletOutputStream output = resp.getOutputStream(); 47 | try { 48 | 49 | int count = Integer.parseInt(myfile.getfDowncount()); 50 | count++; 51 | fileService.editcount(count + "", myfile.getfId()); 52 | // IOUtils.copy(input, output);// 把输入流中的数据写入到输出流中。 53 | byte[] bytes = new byte[1024 * 4]; 54 | int len = 0; 55 | while ((len = input.read(bytes)) != -1) { 56 | output.write(bytes, 0, len); 57 | 58 | } 59 | 60 | } catch (Exception e) { 61 | System.out.println("报错了"); 62 | } finally { 63 | System.out.println("清空了"); 64 | input.close(); 65 | output.flush(); 66 | output.close(); 67 | 68 | } 69 | } 70 | 71 | public static String filenameEncoding(String filename, 72 | HttpServletRequest request) throws IOException { 73 | String agent = request.getHeader("User-Agent"); // 获取浏览器 74 | if (agent.contains("Firefox")) { 75 | BASE64Encoder base64Encoder = new BASE64Encoder(); 76 | filename = "=?utf-8?B?" 77 | + base64Encoder.encode(filename.getBytes("utf-8")) + "?="; 78 | } else if (agent.contains("MSIE")) { 79 | filename = URLEncoder.encode(filename, "utf-8"); 80 | } else { 81 | filename = URLEncoder.encode(filename, "utf-8"); 82 | } 83 | return filename; 84 | 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/servlet/FileServlet.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.servlet; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import lz.xawl.File.domain.File; 11 | import lz.xawl.File.service.FileService; 12 | 13 | import cn.itcast.servlet.BaseServlet; 14 | 15 | public class FileServlet extends BaseServlet { 16 | 17 | private FileService fileService = new FileService(); 18 | 19 | // 删除file ,暂时是单个文件 ,后面实现批量删除 20 | public String deleteFile(HttpServletRequest request, 21 | HttpServletResponse response) throws ServletException, IOException { 22 | 23 | String fid = request.getParameter("fid"); 24 | // 从数据中删除记录,但是还有文件 25 | 26 | File f = fileService.findByFid(fid); 27 | String filePath = f.getfPath(); 28 | if (("").equals(f.getfHash()) || f.getfHash().isEmpty()) { 29 | // 说明他是被封人家的 只删除数据库的信息 30 | fileService.deleteByFid(fid); 31 | response.getWriter().write("true"); 32 | return null; 33 | } else { 34 | File f1 = fileService.findByPath(filePath); 35 | 36 | try { 37 | java.io.File abf = new java.io.File(this.getServletContext() 38 | .getRealPath(filePath)); 39 | fileService.deleteByFid(fid); 40 | abf.delete(); 41 | } catch (Exception e) { 42 | response.getWriter().write("false"); 43 | return null; 44 | } 45 | response.getWriter().write("true"); 46 | return null; 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/servlet/ProgressServlet.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.servlet; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.http.HttpServlet; 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | import javax.servlet.http.HttpSession; 9 | 10 | public class ProgressServlet extends HttpServlet { 11 | 12 | public void doPost(HttpServletRequest request, HttpServletResponse response) { 13 | HttpSession session = request.getSession(); 14 | fileUploadStatus status = (fileUploadStatus) session 15 | .getAttribute("status"); 16 | try { 17 | response.reset(); 18 | response.getWriter().write( 19 | "{\"pBytesRead\":" + status.getPBytesRead() 20 | + ",\"pContentLength\":" 21 | + status.getPContentLength() + "}"); 22 | } catch (IOException e) { 23 | e.printStackTrace(); 24 | } 25 | 26 | } 27 | 28 | public void doGet(HttpServletRequest request, HttpServletResponse response) { 29 | this.doPost(request, response); 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/servlet/UploadServlet.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.servlet; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.io.PrintWriter; 6 | import java.text.SimpleDateFormat; 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | import javax.servlet.ServletException; 11 | import javax.servlet.http.HttpServlet; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | 15 | import lz.xawl.Catalog.domain.Catalog; 16 | import lz.xawl.Catalog.service.CatalogService; 17 | import lz.xawl.File.service.FileService; 18 | import lz.xawl.Util.Tool; 19 | 20 | import org.apache.commons.fileupload.FileItem; 21 | import org.apache.commons.fileupload.FileItemFactory; 22 | import org.apache.commons.fileupload.disk.DiskFileItemFactory; 23 | import org.apache.commons.fileupload.servlet.ServletFileUpload; 24 | 25 | public class UploadServlet extends HttpServlet { 26 | 27 | private FileService fileservice = new FileService(); 28 | private CatalogService catalogservice = new CatalogService(); 29 | 30 | @Override 31 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) 32 | throws ServletException, IOException { 33 | // 如果要实现不同用户不同文件夹,这里需要拿到user用户 34 | PrintWriter out = resp.getWriter(); 35 | 36 | req.setCharacterEncoding("utf-8"); 37 | resp.setContentType("text/html;charset=utf-8"); 38 | // 插件工厂 39 | FileItemFactory factory = new DiskFileItemFactory(); 40 | ServletFileUpload upload = new ServletFileUpload(factory); 41 | upload.setSizeMax(1024 * 1024 * 500);// 50M 42 | upload.setHeaderEncoding("utf-8"); 43 | myProgressListener getBarListener = new myProgressListener(req); 44 | upload.setProgressListener(getBarListener); 45 | List fileList = null; 46 | 47 | try { 48 | fileList = upload.parseRequest(req); 49 | } catch (Exception e) { 50 | out.write(""); 51 | return; 52 | } 53 | // 获取图片 54 | String hash = null; 55 | FileItem file = fileList.get(0); 56 | String cid = fileList.get(1).getString("utf-8"); 57 | try { 58 | hash = Tool.getMD5Checksum(file.getInputStream()); 59 | // 得到了hash 应该去数据库查询一下 如果已经存在就不上传了 60 | 61 | lz.xawl.File.domain.File f = fileservice.findByHash(hash); 62 | 63 | if (f != null) { 64 | // 说明已经存在改文件了直接写入数据库中 65 | System.out.println("文件名:" + f.getfName()); 66 | lz.xawl.File.domain.File file2 = new lz.xawl.File.domain.File(); 67 | file2.setfPath(f.getfPath()); 68 | file2.setfSize(f.getfSize()); 69 | file2.setfType(f.getfType()); 70 | file2.setfName(f.getfName()); 71 | file2.setfHash(""); 72 | file2.setfDiskName(f.getfDiskName()); 73 | String fid = Tool.randomId(); // 文件id 74 | file2.setfId(fid); 75 | file2.setfDowncount("0"); 76 | file2.setfDesc("暂留"); 77 | SimpleDateFormat simp1 = new SimpleDateFormat("yyyy-MM-dd"); 78 | String date = simp1.format(new Date()).toString(); 79 | file2.setfUploadtime(date); 80 | file2.setIsShare("0"); 81 | Catalog c1 = new Catalog(); 82 | c1.setcId(cid); 83 | file2.setCatalog(c1); 84 | fileservice.upLoadFile(file2); 85 | String cf = catalogservice.cidTocf(cid); 86 | if (cf == null || cf.isEmpty() || "".equals(cf)) { 87 | // 说明文件夹下暂时没有文件 88 | String sCf = Tool.randomId();// 生成cf值 89 | catalogservice.intoCf(cid, sCf); 90 | // 开始写入fid值 91 | fileservice.writecf(fid, sCf); 92 | } else { 93 | fileservice.writecf(fid, cf); 94 | } 95 | out.write(""); 97 | return; 98 | } 99 | 100 | } catch (Exception e1) { 101 | e1.printStackTrace(); 102 | } 103 | 104 | String filename = file.getName(); 105 | String fileQian = null; // 文件名,不包含后缀 106 | String fileExt = null; // 后缀文件类型 107 | // 截图名字名 部分浏览器给的是绝对路径 108 | int indes = filename.lastIndexOf("\\"); 109 | if (indes != -1) { 110 | filename = filename.substring(indes + 1); 111 | } 112 | 113 | int indes2 = filename.lastIndexOf("."); 114 | if (indes2 != -1) { 115 | fileQian = filename.substring(0, indes2); 116 | 117 | fileExt = filename.substring(indes2 + 1); 118 | 119 | } 120 | 121 | // 开始上传文件 文件名重名问题需要解决 并且按用户分文件夹! 122 | String savePath = this.getServletContext().getRealPath("/upload"); 123 | // 看是否存在 不存在就要创建 124 | File path = new File(savePath); 125 | if (!path.exists()) { 126 | path.mkdirs(); 127 | } 128 | String filename2 = fileQian 129 | + " " 130 | + new SimpleDateFormat("hh-mm-ss").format(new Date()) 131 | .toString() + "." + fileExt; 132 | 133 | File imgfile = new File(savePath, filename2); // 绝对路径的文件 134 | 135 | try { 136 | file.write(imgfile); 137 | } catch (Exception e) { 138 | throw new RuntimeException(e); 139 | } 140 | // 上传完成 开始写数据库保存 141 | lz.xawl.File.domain.File myfile = new lz.xawl.File.domain.File(); 142 | myfile.setfPath("/upload/" + filename2); 143 | myfile.setfSize(file.getSize()); 144 | myfile.setfType(fileExt); 145 | myfile.setfName(filename); 146 | myfile.setfHash(hash); 147 | myfile.setfDiskName(filename2); 148 | String fid = Tool.randomId(); // 文件id 149 | myfile.setfId(fid); 150 | myfile.setfDowncount("0"); 151 | myfile.setfDesc("暂留"); 152 | SimpleDateFormat simp = new SimpleDateFormat("yyyy-MM-dd"); 153 | String date = simp.format(new Date()).toString(); 154 | myfile.setfUploadtime(date); 155 | myfile.setIsShare("0"); 156 | Catalog c = new Catalog(); 157 | c.setcId(cid); 158 | myfile.setCatalog(c); 159 | fileservice.upLoadFile(myfile);// 文件表写好了还需要写2个表 160 | // 先判断对应的文件夹是否有文件cf 值是否为空 161 | String cf = catalogservice.cidTocf(cid); 162 | if (cf == null || cf.isEmpty() || "".equals(cf)) { 163 | // 说明文件夹下暂时没有文件 164 | String sCf = Tool.randomId();// 生成cf值 165 | catalogservice.intoCf(cid, sCf); 166 | // 开始写入fid值 167 | fileservice.writecf(fid, sCf); 168 | } else { 169 | fileservice.writecf(fid, cf); 170 | } 171 | // 数据表写完成了, 172 | // PrintWriter out=resp.getWriter(); 173 | 174 | out.write(""); 176 | } 177 | 178 | } 179 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/servlet/fileUploadStatus.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.servlet; 2 | 3 | public class fileUploadStatus { 4 | private long pBytesRead = 0L; 5 | private long pContentLength = 0L; 6 | 7 | public fileUploadStatus() { 8 | pBytesRead = 0L; 9 | pContentLength = 0L; 10 | } 11 | 12 | public long getPBytesRead() { 13 | return pBytesRead; 14 | } 15 | 16 | public void setPBytesRead(long bytesRead) { 17 | pBytesRead = bytesRead; 18 | } 19 | 20 | public long getPContentLength() { 21 | return pContentLength; 22 | } 23 | 24 | public void setPContentLength(long contentLength) { 25 | pContentLength = contentLength; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/File/servlet/myProgressListener.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.File.servlet; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | 6 | import org.apache.commons.fileupload.ProgressListener; 7 | 8 | public class myProgressListener implements ProgressListener { 9 | 10 | private HttpSession session; 11 | 12 | public myProgressListener(HttpServletRequest req) { 13 | session = req.getSession(); 14 | fileUploadStatus status = new fileUploadStatus(); 15 | session.setAttribute("status", status); 16 | } 17 | 18 | /* 19 | * pBytesRead 到目前为止读取文件的比特数 pContentLength 文件总大小 20 | */ 21 | public void update(long pBytesRead, long pContentLength, int pItems) { 22 | fileUploadStatus status = (fileUploadStatus) session 23 | .getAttribute("status"); 24 | status.setPBytesRead(pBytesRead); 25 | status.setPContentLength(pContentLength); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /mydisks/src/lz/xawl/Util/Tool.java: -------------------------------------------------------------------------------- 1 | package lz.xawl.Util; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.InputStream; 5 | import java.security.MessageDigest; 6 | import java.util.List; 7 | import java.util.Random; 8 | 9 | import lz.xawl.File.domain.File; 10 | 11 | public class Tool { 12 | /** 13 | * 生成随机四位字符串 14 | * 15 | * @return 16 | */ 17 | public static String randomId() { 18 | 19 | String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 20 | Random random = new Random(); 21 | StringBuffer sb = new StringBuffer(); 22 | 23 | for (int i = 0; i < 4; ++i) { 24 | int number = random.nextInt(62);// [0,62) 25 | 26 | sb.append(str.charAt(number)); 27 | } 28 | return sb.toString(); 29 | } 30 | 31 | public static byte[] createChecksum(InputStream fis) throws Exception { 32 | byte[] buffer = new byte[1024]; 33 | MessageDigest complete = MessageDigest.getInstance("MD5"); 34 | int numRead; 35 | 36 | do { 37 | numRead = fis.read(buffer); 38 | if (numRead > 0) { 39 | complete.update(buffer, 0, numRead); 40 | } 41 | } while (numRead != -1); 42 | 43 | fis.close(); 44 | return complete.digest(); 45 | } 46 | 47 | /** 48 | * 获取文件的hash 49 | * @param filename 50 | * @return 51 | * @throws Exception 52 | */ 53 | public static String getMD5Checksum(InputStream in) throws Exception { 54 | byte[] b = createChecksum(in); 55 | String result = ""; 56 | 57 | for (int i = 0; i < b.length; i++) { 58 | result += Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1); 59 | } 60 | return result; 61 | } 62 | 63 | public static void deleteFileList(List myfile){ 64 | 65 | } 66 | 67 | } 68 | --------------------------------------------------------------------------------