I need to know how I get the current directory of my application, since I need to save some PDF files. I've tried it a few times, but to no avail. 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;