• tofuwine

    获取 Spring Boot 注入的对象的原始 class:

    java
    1
    2
    3
    4
    
    import org.springframework.aop.support.AopUtils;
    
    // 使用 Spring 自带工具实现
    AopUtil.getTargetClass()
    Spring Boot
    2023-12-13 15:27
  • tofuwine

    Internet Download Manager Activation Script:

    lstprjct/IDM-Activation-Script

    快速激活:

    powershell
    1
    
    iex(irm is.gd/idm_reset)
    IDM Activation
    2023-09-04 09:28
  • tofuwine

    引入 Spring Boot 依赖的两种方式:

    Parent

    xml
    1
    2
    3
    4
    5
    
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.1.2</version>
    </parent>

    依赖管理

    xml
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>3.1.2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    Java Spring Boot
    2023-08-25 14:43
  • tofuwine

    指定一个目录,获取该目录下(包含子目录)的所有 txt 文件:

    依赖:commons-io:commons-io

    java
    1
    
    FileUtils.listFiles(new File(filePath), new SuffixFileFilter("txt"), DirectoryFileFilter.INSTANCE);
    Java
    2023-08-08 13:41