Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Basic Commit
  • Loading branch information
Avinash Yachamaneni committed Oct 5, 2018
commit 047608b9a1e105a65e9f2fed647a09719a7ec790
14 changes: 11 additions & 3 deletions src/main/java/com/example/filedemo/service/FileStorageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -19,12 +21,18 @@
@Service
public class FileStorageService {

private final Path fileStorageLocation;
private Path fileStorageLocation;

@Autowired
public FileStorageService(FileStorageProperties fileStorageProperties) {
this.fileStorageLocation = Paths.get(fileStorageProperties.getUploadDir())
.toAbsolutePath().normalize();
// this.fileStorageLocation = Paths.get(fileStorageProperties.getUploadDir())
// .toAbsolutePath().normalize();
try {
this.fileStorageLocation = Paths.get(new URI("/Users/TestApk"));
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

try {
Files.createDirectories(this.fileStorageLocation);
Expand Down