본문 바로가기

Programming277

[JAVA] zip4j 이용하여 파일 앞축 및 암호 설정 테스트 진행 net.lingala.zip4j 라이브러리를 이용하여 테스트 해보았습니다! package com.doc.controller; import java.io.File; import java.io.IOException; import java.util.HashMap; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import net.lingala.zip4j.ZipFile; import net.lingala.zip4j.model.ZipPa.. 2023. 10. 24.
특정 위치에 파일 중복 여부 체크 하고 새로운 파일명 구하기 예제 특정 위치에 파일 중복 여부 체크 하고 새로운 파일명 구하기 예제 특정위치에 동일한 파일명이 존재하는지 체크하고 , 동일한 파일명이 존재한다면 ex) 파일(1).jpg , 파일(2).jpg로 변경 처리하는 방안 입니다! * 기존 C# 으로 예제를 만들어 놓은것을 JAVA 로도 작성 해 보았습니다. import java.io.File; import org.apache.commons.io.FilenameUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class CommonUtils { private final static Logger logger = LogManager.getLogg.. 2023. 9. 7.
특정 위치에 파일 중복 여부 체크 하고 새로운 파일명 구하기 예제 특정 위치에 파일 중복 여부 체크 하고 새로운 파일명 구하기 예제 특정위치에 동일한 파일명이 존재하는지 체크하고 , 동일한 파일명이 존재한다면 ex) 파일(1).jpg , 파일(2).jpg로 변경 처리하는 방안 입니다! public static class ExtentionMethods { public static string FileNameDupCheck(this string fullPath) { if (File.Exists(fullPath)) { string reNamePath = string.Empty; string filePath = Path.GetDirectoryName(fullPath); string fileName = Path.GetFileNameWithoutExtension(fullPath).. 2023. 8. 23.
Mybatis PlatformTransactionManager 프로그래밍 방식으로 호출 진행 예 스프링 PlatformTransactionManager 로 DB 트랜잭션 관리하는 방법 : 네이버 블로그 (naver.com) 스프링 PlatformTransactionManager 로 DB 트랜잭션 관리하는 방법 스프링 PlatformTransactionManager 로 DB 트랜잭션 소스 코드를 개발하는 방법은 다음과 같습니다. 1... blog.naver.com 1. contextConfigLocation 의 XML 에 bean으로 추가 합니다.! 2. Service 의존성 주입 진행 3. Service Class 에 선언 진행 public class TestService { private SqlSession sqlSession; private PlatformTransactionManager tra.. 2023. 8. 17.