Skip to content

Commit 4d21f57

Browse files
committed
File Upload and Dwnload using local server
1 parent 09ae00d commit 4d21f57

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/SpringbootUploadDownloadFileApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javaguides.springboot.fileuploaddownload;
1+
package net.alanbinu.springboot.fileuploaddownload;
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/controller/FileDownloadController.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javaguides.springboot.fileuploaddownload.controller;
1+
package net.alanbinu.springboot.fileuploaddownload.controller;
22

33
import javax.servlet.http.HttpServletRequest;
44

@@ -14,8 +14,8 @@
1414
import org.springframework.web.bind.annotation.PathVariable;
1515
import org.springframework.web.bind.annotation.RestController;
1616

17-
import net.javaguides.springboot.fileuploaddownload.model.DatabaseFile;
18-
import net.javaguides.springboot.fileuploaddownload.service.DatabaseFileService;
17+
import net.alanbinu.springboot.fileuploaddownload.model.DatabaseFile;
18+
import net.alanbinu.springboot.fileuploaddownload.service.DatabaseFileService;
1919

2020
@RestController
2121
public class FileDownloadController {

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/controller/FileUploadController.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javaguides.springboot.fileuploaddownload.controller;
1+
package net.alanbinu.springboot.fileuploaddownload.controller;
22

33
import java.util.Arrays;
44
import java.util.List;
@@ -11,9 +11,9 @@
1111
import org.springframework.web.multipart.MultipartFile;
1212
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
1313

14-
import net.javaguides.springboot.fileuploaddownload.model.DatabaseFile;
15-
import net.javaguides.springboot.fileuploaddownload.payload.Response;
16-
import net.javaguides.springboot.fileuploaddownload.service.DatabaseFileService;
14+
import net.alanbinu.springboot.fileuploaddownload.model.DatabaseFile;
15+
import net.alanbinu.springboot.fileuploaddownload.payload.Response;
16+
import net.alanbinu.springboot.fileuploaddownload.service.DatabaseFileService;
1717

1818
@RestController
1919
public class FileUploadController {

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/exception/FileNotFoundException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javaguides.springboot.fileuploaddownload.exception;
1+
package net.alanbinu.springboot.fileuploaddownload.exception;
22

33
import org.springframework.http.HttpStatus;
44
import org.springframework.web.bind.annotation.ResponseStatus;

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/exception/FileStorageException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javaguides.springboot.fileuploaddownload.exception;
1+
package net.alanbinu.springboot.fileuploaddownload.exception;
22

33
public class FileStorageException extends RuntimeException {
44

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/model/DatabaseFile.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javaguides.springboot.fileuploaddownload.model;
1+
package net.alanbinu.springboot.fileuploaddownload.model;
22

33
import org.hibernate.annotations.GenericGenerator;
44

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/payload/Response.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javaguides.springboot.fileuploaddownload.payload;
1+
package net.alanbinu.springboot.fileuploaddownload.payload;
22

33

44
public class Response {

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/repository/DatabaseFileRepository.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package net.javaguides.springboot.fileuploaddownload.repository;
1+
package net.alanbinu.springboot.fileuploaddownload.repository;
22

33
import org.springframework.data.jpa.repository.JpaRepository;
44
import org.springframework.stereotype.Repository;
55

6-
import net.javaguides.springboot.fileuploaddownload.model.DatabaseFile;
6+
import net.alanbinu.springboot.fileuploaddownload.model.DatabaseFile;
77

88
@Repository
99
public interface DatabaseFileRepository extends JpaRepository<DatabaseFile, String> {

springboot-upload-download-file-database/src/main/java/net/alanbinu/springboot/fileuploaddownload/service/DatabaseFileService.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javaguides.springboot.fileuploaddownload.service;
1+
package net.alanbinu.springboot.fileuploaddownload.service;
22

33
import java.io.IOException;
44

@@ -7,10 +7,10 @@
77
import org.springframework.util.StringUtils;
88
import org.springframework.web.multipart.MultipartFile;
99

10-
import net.javaguides.springboot.fileuploaddownload.exception.FileNotFoundException;
11-
import net.javaguides.springboot.fileuploaddownload.exception.FileStorageException;
12-
import net.javaguides.springboot.fileuploaddownload.model.DatabaseFile;
13-
import net.javaguides.springboot.fileuploaddownload.repository.DatabaseFileRepository;
10+
import net.alanbinu.springboot.fileuploaddownload.exception.FileNotFoundException;
11+
import net.alanbinu.springboot.fileuploaddownload.exception.FileStorageException;
12+
import net.alanbinu.springboot.fileuploaddownload.model.DatabaseFile;
13+
import net.alanbinu.springboot.fileuploaddownload.repository.DatabaseFileRepository;
1414

1515
@Service
1616
public class DatabaseFileService {

0 commit comments

Comments
 (0)