【在线文件管理】响应式文件管理AngularJS

目录

1.功能展示截图

2.实现代码

2.1HTML页面代码

2.2后台代码

2.2.1项目结构

2.2.2项目代码

其他问题


1.功能展示截图

项目中需要用到文件管理来自由控制文件的上传、下载、删除等,就想到做一个简单的在线文件管理功能。

支持在线编辑:

2.实现代码

2.1HTML页面代码

必要引入:
<!-- <link rel="stylesheet" href="/assets/css/glyphicons.css"> -->
<script src="/assets/js/old/jquery.min.js"></script>
<script src="/assets/js/angular.min.js"></script>
<script src="/assets/js/angular-translate.min.js"></script>
<script src="/assets/js/ng-file-upload.min.js"></script>
<script src="/assets/js/old/bootstrap.min.js"></script>
<link rel="stylesheet" href="/assets/css/old/bootstrap.min.css" />
<!-- <link href="/assets/css/angular-filemanager.min.css" rel="stylesheet"> -->
<script src="/assets/js/angular-filemanager.min.js"></script>

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"  data-ng-app="FileManagerApp" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head><th:block th:include="include :: header('文件上传下载分析列表')" /><meta http-equiv="X-UA-Compatible" content="I EmulateIE8" /><!-- 	<link rel="shortcut icon" href="/assets/img/efo-favicon.png" /> --><link type="text/css" th:href="@{/css/glyphicons.css}" rel="stylesheet"  /><script type="text/javascript" th:src="@{/js/jquery.min.js}"></script><script type="text/javascript" th:src="@{/js/angular.min.js}"></script><script type="text/javascript" th:src="@{/js/angular-translate.min.js}"></script><script type="text/javascript" th:src="@{/js/ng-file-upload.min.js}"></script><script type="text/javascript" th:src="@{/js/bootstrap.min.js}"></script><link type="text/css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"  /><link type="text/css" th:href="@{/css/angular-filemanager.min.css}" rel="stylesheet"  /><script type="text/javascript" th:src="@{/js/angular-filemanager.min.js}"></script><script type="text/javascript">angular.module('FileManagerApp').config(['fileManagerConfigProvider', function (config) {var defaults = config.$get();config.set({appName: '远程文件管理',pickCallback: function (item) {var msg = 'Picked %s "%s" for external use'.replace('%s', item.type).replace('%s', item.fullPath());window.alert(msg);},allowedActions: angular.extend(defaults.allowedActions, {pickFiles: false,pickFolders: false})});}]);</script>
</head>
<body  id="particles-js" class="gray-bg ng-cloak">
<!-- <body class="gray-bg ng-cloak" id="particles-js"> -->
<!-- 	<h1>测试</h1> --><angular-filemanager></angular-filemanager>
<!--     <th:block th:include="include :: footer" /> -->
</body>
</html>

2.2后台代码

2.2.1项目结构

2.2.2项目代码

        DefaultValues.java

package com.ruoyi.efo.modules.constant;import com.zhazhapan.modules.constant.ValueConsts;/*** @author t* @since xx*/
public class DefaultValues {/*** 未分类*/public static final String UNCATEGORIZED = "未分类";/*** 404页面路径*/public static final String NOT_FOUND_PAGE = "/404.html";/*** Controller包路径*/public static final String CONTROLLER_PACKAGE = "com.zhazhapan.efo.web.controller";/*** 配置文件路径*/public static final String SETTING_PATH = "/config.json";/*** 冒号*/public static final String COLON = ":";/*** 默认存储路径*/public static final String STORAGE_PATH = ValueConsts.USER_HOME + ValueConsts.SEPARATOR + "Desktop" + ValueConsts.SEPARATOR;/*** 首页映射路径*/public static final String INDEX_PAGE = "/index";/*** 配置映射的路径*/public static final String CONFIG_PAGE = "/config";/*** 资源映射的路径*/public static final String ASSETS_PAGE = "/assets";/*** 登陆注册页面映射路径*/public static final String SIGNIN_PAGE = "/signin";/*** 管理员页面映射路径*/public static final String ADMIN_PAGE = "/admin";/*** int型数值3*/public static final int THREE_INT = 3;/*** int型数值2*/public static final int TWO_INT = 2;/*** code字符*/public static final String CODE_STRING = "code";private DefaultValues() {}
}

         IFileManagerService

package com.ruoyi.efo.service;import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;import org.springframework.web.multipart.MultipartFile;import javax.servlet.http.HttpServletResponse;
import java.io.IOException;/*** @author xx* @since 2023/7/7*/
public interface IFileManagerService {/*** 下载多个文件** @param response {@link HttpServletResponse}* @param items 文件集* @param destFile 目标文件名** @throws IOException 异常*/void multiDownload(HttpServletResponse response, String[] items, String destFile) throws IOException;/*** 上传文件(暂时还没有实现)** @param destination 目标文件* @param files {@link MultipartFile}** @return {@link JSONObject}*/JSONObject upload(String destination, MultipartFile... files);/*** 解压文件** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject extract(JSONObject object);/*** 压缩文件** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject compress(JSONObject object);/*** 设置文件权限** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject setPermission(JSONObject object);/*** 创建文件夹** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject createFolder(JSONObject object);/*** 获取文件内容** @param object {@link JSONObject}** @return 文件内容*/String getContent(JSONObject object);/*** 编辑文件** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject edit(JSONObject object);/*** 移除文件** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject remove(JSONObject object);/*** 复制文件** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject copy(JSONObject object);/*** 移动文件** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject move(JSONObject object);/*** 重命名** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONObject rename(JSONObject object);/*** 列出文件** @param object {@link JSONObject}** @return {@link JSONObject}*/JSONArray list(JSONObject object);
}

        FileManagerServiceImpl

package com.ruoyi.efo.service.impl;import cn.hutool.core.util.ZipUtil;import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.efo.modules.constant.DefaultValues;
import com.ruoyi.efo.service.IFileManagerService;
import com.zhazhapan.modules.constant.ValueConsts;
import com.zhazhapan.util.Checker;
import com.zhazhapan.util.FileExecutor;
import com.zhazhapan.util.Formatter;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;import javax.servlet.http.HttpServletResponse;
import javax.swing.filechooser.FileSystemView;
import java.io.File;
import java.io.IOException;
import java.util.Date;/*** @author xx* @since 2023/7/7*/
@Service
public class FileManagerServiceImpl implements IFileManagerService {private static Logger logger = Logger.getLogger(FileManagerServiceImpl.class);@Overridepublic void multiDownload(HttpServletResponse response, String[] items, String destFile) throws IOException {File zip = ZipUtil.zip(new File(ValueConsts.USER_DESKTOP + File.separator + destFile), ValueConsts.FALSE,FileExecutor.getFiles(items));if (zip.exists()) {response.getOutputStream().write(FileExecutor.readFileToByteArray(zip));FileExecutor.deleteFile(zip);}}@Overridepublic JSONObject upload(String destination, MultipartFile... files) {System.out.println(files.length);if (Checker.isNotEmpty(files)) {if (Checker.isWindows() && destination.length() < ValueConsts.TWO_INT) {destination = "C:";}for (MultipartFile file : files) {if (Checker.isNotNull(file) && !file.isEmpty()) {try {file.transferTo(new File(destination + File.separator + file.getOriginalFilename()));} catch (IOException e) {logger.error(e.getMessage());return getBasicResponse(ValueConsts.FALSE);}}}}return getBasicResponse(ValueConsts.TRUE);}@Overridepublic JSONObject extract(JSONObject object) {String destination = object.getString("destination") + File.separator + object.getString("folderName");String zipFile = object.getString("item");return getBasicResponse(ZipUtil.unzip(zipFile, destination).exists());}@Overridepublic JSONObject compress(JSONObject object) {JSONArray array = object.getJSONArray("items");File[] files = new File[array.size()];int i = 0;for (Object file : array) {files[i++] = new File(file.toString());}String dest = object.getString("destination");String name = object.getString("compressedFilename");File zip = ZipUtil.zip(new File(dest + File.separator + name), ValueConsts.FALSE, files);return getBasicResponse(zip.exists());}@Overridepublic JSONObject setPermission(JSONObject object) {if (Checker.isLinux()) {JSONArray array = object.getJSONArray("items");int code = object.getInteger("permsCode");for (Object file : array) {try {Runtime.getRuntime().exec("chmod -R " + code + " " + file.toString());} catch (IOException e) {logger.error(e.getMessage());return getBasicResponse(ValueConsts.FALSE);}}}return getBasicResponse(ValueConsts.TRUE);}@Overridepublic JSONObject createFolder(JSONObject object) {String folder = object.getString("newPath");return getBasicResponse(FileExecutor.createFolder(folder));}@Overridepublic String getContent(JSONObject object) {String fileName = object.getString("item");try {return FileExecutor.readFile(fileName);} catch (IOException e) {logger.error(e.getMessage());return "";}}@Overridepublic JSONObject edit(JSONObject object) {String file = object.getString("item");String content = object.getString("content");try {FileExecutor.saveFile(file, content);return getBasicResponse(ValueConsts.TRUE);} catch (IOException e) {logger.error(e.getMessage());return getBasicResponse(ValueConsts.FALSE);}}@Overridepublic JSONObject remove(JSONObject object) {JSONArray array = object.getJSONArray("items");array.forEach(file -> FileExecutor.deleteFile(file.toString()));return getBasicResponse(ValueConsts.TRUE);}@Overridepublic JSONObject copy(JSONObject object) {JSONArray array = object.getJSONArray("items");String dest = object.getString("newPath");File[] files = new File[array.size()];int i = 0;for (Object file : array) {files[i++] = new File(file.toString());}try {FileExecutor.copyFiles(files, dest);return getBasicResponse(ValueConsts.TRUE);} catch (IOException e) {logger.error(e.getMessage());return getBasicResponse(ValueConsts.FALSE);}}@Overridepublic JSONObject move(JSONObject object) {JSONArray array = object.getJSONArray("items");String dest = object.getString("newPath");for (Object file : array) {try {FileExecutor.moveToDirectory(new File(file.toString()), new File(dest), ValueConsts.TRUE);} catch (IOException e) {logger.error(e.getMessage());return getBasicResponse(ValueConsts.FALSE);}}return getBasicResponse(ValueConsts.TRUE);}@Overridepublic JSONObject rename(JSONObject object) {String fileName = object.getString("item");String newFileName = object.getString("newItemPath");FileExecutor.renameTo(fileName, newFileName);return getBasicResponse(ValueConsts.TRUE);}@Overridepublic JSONArray list(JSONObject object) {String path = object.getString("path");JSONArray array = new JSONArray();File[] files = null;if (Checker.isWindows()) {if (Checker.isNotEmpty(path) && path.startsWith(ValueConsts.SPLASH_STRING)) {path = path.substring(1);}if (Checker.isEmpty(path)) {FileSystemView fsv = FileSystemView.getFileSystemView();File[] fs = File.listRoots();for (File file : fs) {if (file.getTotalSpace() > 0) {String displayName = fsv.getSystemDisplayName(file);int len = displayName.length();JSONObject jsonObject = new JSONObject();jsonObject.put("name", displayName.substring(len - 3, len - 1));jsonObject.put("rights", "----------");jsonObject.put("size", file.getTotalSpace() - file.getFreeSpace());jsonObject.put("date", Formatter.datetimeToString(new Date(file.lastModified())));jsonObject.put("type", file.isDirectory() ? "dir" : "file");array.add(jsonObject);}}} else if (path.startsWith(DefaultValues.COLON, 1)) {files = FileExecutor.listFile(path.endsWith(DefaultValues.COLON) ? path + File.separator : path);} else {logger.error("path error");}} else {files = FileExecutor.listFile(Checker.isEmpty(path) ? "/" : (path.startsWith("/") ? path : "/" + path));}if (Checker.isNotNull(files)) {for (File file : files) {JSONObject jsonObject = new JSONObject();jsonObject.put("name", file.getName());jsonObject.put("rights", "----------");jsonObject.put("size", file.length());jsonObject.put("date", Formatter.datetimeToString(new Date(file.lastModified())));jsonObject.put("type", file.isDirectory() ? "dir" : "file");array.add(jsonObject);}}return array;}private JSONObject getBasicResponse(boolean isSuccess) {JSONObject jsonObject = new JSONObject();if (isSuccess) {jsonObject.put("success", true);jsonObject.put("error", null);} else {jsonObject.put("success", null);jsonObject.put("error", "服务器异常");}return jsonObject;}
}

        ControllerUtils

package com.ruoyi.efo.util;import com.alibaba.fastjson.JSONObject;
import com.ruoyi.efo.modules.constant.DefaultValues;
import com.zhazhapan.util.Checker;import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;/*** @author xx* @since 2023/7/7*/
public class ControllerUtils {private ControllerUtils() {}/*** 获取一个简单的响应状态** @param isSuccess 是否操作成功** @return 响应JSON字符串*/public static String getResponse(boolean isSuccess) {JSONObject jsonObject = new JSONObject();if (isSuccess) {jsonObject.put("status", "success");} else {jsonObject.put("status", "error");}return jsonObject.toString();}/*** 加载本地资源** @param response 返回的Response* @param path 资源路径* @param download 直接下载*/public static void loadResource(HttpServletResponse response, String path, boolean download) throws IOException {if (Checker.isNotEmpty(path)) {File file = new File(path);if (download) {setResponseFileName(response, file.getName());}FileInputStream in = new FileInputStream(file);ServletOutputStream os = response.getOutputStream();byte[] b;while (in.available() > 0) {b = in.available() > 1024 ? new byte[1024] : new byte[in.available()];in.read(b, 0, b.length);os.write(b, 0, b.length);}in.close();os.flush();os.close();} else {response.sendRedirect(DefaultValues.NOT_FOUND_PAGE);}}/*** 设置响应头的文件名** @param response {@link HttpServletResponse}* @param fileName 文件名*/public static void setResponseFileName(HttpServletResponse response, String fileName) throwsUnsupportedEncodingException {response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("UTF-8"),"ISO-8859-1"));}
}

        FileMangerController

package com.ruoyi.efo.web.controller;import java.io.IOException;
import java.util.Map;import javax.servlet.http.HttpServletResponse;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;import com.alibaba.fastjson.JSONObject;
import com.ruoyi.efo.service.IFileManagerService;
import com.ruoyi.efo.util.ControllerUtils;
import com.zhazhapan.modules.constant.ValueConsts;
import com.zhazhapan.util.ArrayUtils;import springfox.documentation.annotations.ApiIgnore;/*** <a href="https://github.com/joni2back/angular-filemanager/blob/master/API.md">see api doc</a>** @author xx* @since 2023/7/7*/
@ApiIgnore
@RestController
@RequestMapping("/filemanager")
//@AuthInterceptor(InterceptorLevel.SYSTEM)
public class FileMangerController{@Autowiredprivate IFileManagerService fileManagerService;JSONObject jsonObject = new JSONObject();//    @Autowired
//    public FileMangerController2(IFileManagerService fileManagerService, JSONObject jsonObject) {
//        this.fileManagerService = fileManagerService;
//        this.jsonObject = jsonObject;
//    }//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/multidownload", method = RequestMethod.GET)public void multiDownload(HttpServletResponse response, String[] items, String toFilename) throws IOException {ControllerUtils.setResponseFileName(response, toFilename);fileManagerService.multiDownload(response, items, toFilename);}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/download", method = RequestMethod.GET)public void download(HttpServletResponse response, String path) throws IOException {ControllerUtils.loadResource(response, path, ValueConsts.TRUE);}/*** 暂时没有找到更好的解决方案** @param destination 目的** @return 响应结果*/
//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/upload", method = RequestMethod.POST)public String upload(String destination, MultipartHttpServletRequest request) {Map<String, MultipartFile> fileMap = request.getFileMap();MultipartFile[] files = ArrayUtils.mapToArray(fileMap, MultipartFile.class);jsonObject.put("result", fileManagerService.upload(destination, files));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/extract", method = RequestMethod.POST)public String extract(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.extract(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/compress", method = RequestMethod.POST)public String compress(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.compress(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/permission", method = RequestMethod.POST)public String setPermission(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.setPermission(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/folder", method = RequestMethod.POST)public String createFolder(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.createFolder(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/content", method = RequestMethod.POST)public String getContent(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.getContent(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/edit", method = RequestMethod.POST)public String edit(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.edit(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/remove", method = RequestMethod.POST)public String remove(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.remove(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/copy", method = RequestMethod.POST)public String copy(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.copy(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/move", method = RequestMethod.POST)public String move(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.move(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/rename", method = RequestMethod.POST)public String rename(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.rename(json));return jsonObject.toJSONString();}//    @AuthInterceptor(InterceptorLevel.SYSTEM)@RequestMapping(value = "/list", method = RequestMethod.POST)public String list(@RequestBody JSONObject json) {jsonObject.put("result", fileManagerService.list(json));return jsonObject.toJSONString();}
}

其他问题

pom引入,其他包自行引入即可

        <dependency>
            <groupId>com.zhazhapan</groupId>
            <artifactId>util</artifactId>
            <version>1.1.0</version>
        </dependency>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/12820.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Vue组件库Element-常见组件-Form表单

Form表单 Form 表单&#xff1a;由输入框、选择器、单选框、多选框等控件组成&#xff0c;用以收集、检验、提交数据 具体关键代码如下&#xff1a; <template><div><el-row><!-- button 按钮 --><el-button>默认按钮</el-button><e…

基于JavaSpringBoot+Vue+uniapp微信小程序实现鲜花商城购物系统

博主介绍&#xff1a;✌全网粉丝30W,csdn特邀作者、博客专家、CSDN新星计划导师、Java领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ &#x1f345;文末获取源码联系&#x1f345; &#x1f447;&#x1f3fb; 精彩专…

Array.from详解

德玛玩前端 2023-07-07 在以往的开发中&#xff0c;对于Array.from的了解是from是Array的静态方法&#xff0c;可以将类数组和迭代对象转换为数组&#xff0c;可以结合Set集合快速实现数组的去重&#xff0c;一直以为Array,from()只有一个参数&#xff0c;不是传类数组就是可迭…

JavaWeb 速通HTML

目录 一、拾枝杂谈 1.网页组成 : 1 结构 2 表现 3 行为 2.HTML入门 : 1 基本介绍 2.基本结构 : 3.HTML标签 : 1 基本说明 2 注意事项 二、常用标签汇总及演示 1.font标签 : 1 定义 2 演示 2.字符实体 : 1 定义 2 演示 3.标题标签 : 1 定义 2 演示 4. 超链接标签 : 1…

Sql Injection — 注入攻击原理-2(实战)

还是实战&#xff0c;如果没什么事的话几乎每天日更 目录 前言一、总结 前言 sql实战-2 提示&#xff1a;以下是本篇文章正文内容&#xff0c;下面案例可供参考 一、 公司的新闻网 我们进入一篇文章&#xff0c;我们发现这个网页应该是ASP动态网页文件 还记得第一篇文章的sq…

嵌入式QT- QT使用MQTT

目录 一、MQTT介绍 二、MQTT概念 2.1 订阅(Subscribtion) 2.2 会话&#xff08;Session&#xff09; 2.3 主题名&#xff08;Topic Name&#xff09; 2.4 主题筛选器&#xff08;Topic Filter&#xff09; 2.5 消息订阅 三、MQTT中的角色 3.1 客户端 3.2 服务器 四、X86平…

Devops系列六(CI篇之jenkinsfile)jenkins将gitlab helm yaml和argocd 串联,自动部署到K8S

一、为什么是jenkinsfile 上文我们说了pipeline&#xff0c;已为本文铺路不少&#xff0c;接下里就是将之串联起来。 先想说下&#xff0c;为什么是jenkinsfile, 因为jenkins job还支持pipeline方式。 这种方式&#xff0c;不建议实际使用&#xff0c;仅限于测试或调试groovy…

mysql 练习---表和表的字段的增删改

环境&#xff1a; 命令&#xff1a; (1)create database Market; (2) create table customers( c_num int(11) primary key auto_increment, c_name varchar(50), c_contact varchar(50), c_city varchar(50), c_birth datetime not null );(3) alter table customers mod…

基于卷积神经网络VGG的猫狗识别

&#xff01;有需要本项目的实验源码的可以私信博主&#xff01; 摘要&#xff1a;随着大数据时代的到来&#xff0c;深度学习、数据挖掘、图像处理等已经成为了一个热门研究方向。深度学习是一个复杂的机器学习算法&#xff0c;在语音和图像识别方面取得的效果&#xff0c;远远…

如何搭建独享的IP代理池?

随着互联网技术的日趋成熟&#xff0c;爬虫已经成为一种常见的数据获取方法。在采集业务中&#xff0c;建立本地IP代理池是非常重要的。今天将与您探讨IP代理池的选择以及如何搭建独享的IP代理池。 独享IP代理池是指由客户单独使用的IP池&#xff0c;优点是客户可以享受池中所…

java Stream流

Stream流是从JDK8以后才有的一个新特性&#xff0c;是专业用于对集合或者数组进行便捷操作的。 Stream流的创建 主要掌握下面四点&#xff1a; 1、如何获取List集合的Stream流&#xff1f; 2、如何获取Set集合的Stream流&#xff1f; 3、如何获取Map集合的Stream流&#xff1f…

Nginx启动、关闭及信息查看命令

1、查找Nginx的位置 ps -aux | grep nginx 2、启动Nginx nginx直接启动&#xff0c;这时候可能出现两种情况&#xff1a; 第一种&#xff0c;就是Nginx已经启动过了&#xff0c;会提示端口被占用&#xff0c;启动失败 我们尝试杀掉占用端口的进程&#xff0c;然后重启 sys…