qkr7828(박재우) 1 year ago
parent
commit
d52548e6d1
  1. 3
      src/main/java/com/palnet/biz/api/bas/flight/service/BasFlightService.java
  2. 6
      src/main/java/com/palnet/comn/utils/SftpUtils.java

3
src/main/java/com/palnet/biz/api/bas/flight/service/BasFlightService.java

@ -373,7 +373,8 @@ public class BasFlightService {
log.info("profile >>>>>>>>>>>> : {} " , profile); log.info("profile >>>>>>>>>>>> : {} " , profile);
if(!"local".equals(profile)) { if(!("local".equals(profile.toString()))) {
log.info("kml parse");
String kml = kmlUtils.generateKMLFromSimpleKml(coords); String kml = kmlUtils.generateKMLFromSimpleKml(coords);
sftpUtils.init(kml, "PLAN-COORDS-" + planSno); sftpUtils.init(kml, "PLAN-COORDS-" + planSno);
} }

6
src/main/java/com/palnet/comn/utils/SftpUtils.java

@ -11,7 +11,6 @@ import java.util.Date;
import java.util.Vector; import java.util.Vector;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.jcraft.jsch.Channel; import com.jcraft.jsch.Channel;
@ -22,7 +21,10 @@ import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpATTRS; import com.jcraft.jsch.SftpATTRS;
import com.jcraft.jsch.SftpException; import com.jcraft.jsch.SftpException;
import lombok.extern.log4j.Log4j2;
@Component @Component
@Log4j2
public class SftpUtils { public class SftpUtils {
private Session session = null; private Session session = null;
@ -66,6 +68,8 @@ public class SftpUtils {
channelSftp.cd(uploadPath); // 원격 디렉토리로 이동 channelSftp.cd(uploadPath); // 원격 디렉토리로 이동
channelSftp.put(inputStream, fileName); // 파일 업로드 channelSftp.put(inputStream, fileName); // 파일 업로드
log.info("파일 업로드 완료");
} catch (JSchException | SftpException | UnsupportedEncodingException e) { } catch (JSchException | SftpException | UnsupportedEncodingException e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {

Loading…
Cancel
Save