2
I need to know how I get the current directory of my application because I need to save some PDF files. I have tried a few times, but without success. Can anyone give me a light? Look how I’m doing:
public String salvarPDF() throws IOException {
String nomeArquivo = FilenameUtils.getName(arquivoUploadPDF.getFileName());
InputStream input = arquivoUploadPDF.getInputstream();
String caminhoCompleto = System.getProperty("user.dir") + "\\src\\main\\webapp\\uploads\\pdfs";
String caminho = "uploads\\pdfs";
OutputStream output = new FileOutputStream(new File(caminhoCompleto, nomeArquivo));
caminho += "\\" + nomeArquivo;