Can't use Relative Paths fileOutputStream?

Discussion in 'Plugin Development' started by ccrama, Apr 30, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ccrama

    Hello Bukkit,
    I'm trying to create zip files using fileOutputStream, but my relative paths don't seem to work (FileNotFoundException). Is there any way around this? This is my code:

    Code:java
    1. File zip = new File( "plugins" + File.separator + "MineVault" + File.separator + s + ".zip");
    2.  

    S is my string, MineVault is the plugin name.

    Thanks,
    ccrama

    Bump, has been 12 hours

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  2. Offline

    xize

    ccrama

    what is the goal you try to archieve?

    what the exception says is that the zip file doesn't exist, FileOutputStream is used to read the file from the output you may want to use FileInputStream or FileWriter in combination with FileInputStream instead because you want to create, however the code you have now isn't enough to help you, please post more information or code and the related stacktrace.
     
  3. Offline

    ZekeMo

    @ccrama
    Take a look at my code on this forum. You can even use relative paths as arguments.
     
Thread Status:
Not open for further replies.

Share This Page