我需要将图像保存到项目文件夹中。这是一个网络应用程序。我无法弄清楚如何找到要保存图像的文件夹的绝对路径。当我尝试创建空文件夹并获取其绝对路径时,我正在获取 Eclipse 路径。
谁能帮我解决这个问题?
这是我试图保存图像的一些代码:
public void saveCustomsLabel(byte[] array, Obj1, String str) throws userException {
    byte[] array2 = null;
    try {
       imageInByte = array;
        OutputStream bos = new ByteArrayOutputStream();
        InputStream bis = new ByteArrayInputStream(imageInByte);
        BufferedImage bImageFromConvert = ImageIO.read(bis);
        File path = new File("Templates/Images/Image.bmp")
        ImageIO.write(bImageFromConvert, "bmp", path);