Default Storage Folder Location

Where is the Default Storage Folder?

I use three features that save a file in a default folder which is different based on the Operating System. I would like to know here are these folder so I can remove the files manually if necessary.

I’m running Ubuntu Linux 20.4.1.

This article on the wiki mentions one of the three location I’m looking for. But even that location I cannot find.

Location 1:

// Allow screenshots
ScreenshotAppState screenShotState = new ScreenshotAppState();
this.stateManager.attach(screenShotState);

This usually produces a file like “screenshot.png”.

Location 2:
Usually the same as location 1.

SaveGame.saveGame("com/sample/highimpact", "gamesave_001", game_save_node);

This produces a file like “gamesave_001”.

Location 3:

try {            
  settings.save("com/sample/highimpact");
            
} catch (BackingStoreException ex) {
  System.out.println("Could not save game configurations.");
}

This one I think I was able to clear the file by going to Java in the Control Panel but that’s not available in Ubuntu Linux.

Previously I was able to find location 1 and 2 in the folder below when using Win10:
C:/Users/MyName/.jm3/

Where Jmonkey 3.6.1 is installed:
/home/myname/programs/jmonkeyplatform

Other folders I’m familiar with:
/opt
/opt/app-name
/usr/local
/usr/bin - Use for binaries.
/usr - This is for official use only. Do not install directly there.

It’s a hidden folder in the user home:

This is equivalent to the C:\users\User.… on windows systems.

1 Like

App settings are stored in Java preferences. You can look at the Java preferences API for more details.

My experience with screen shot app state is that it stores the file in the current working directory.

I don’t use the SaveGame stuff so I don’t know anything about that.

Answer to Location 2:
Show Hidden Folders: Ctrl + H
Folder: /home/myname/.jme3
Source: How to show hidden folders in File Manager (Nautilus) on Ubuntu? - Ask Ubuntu

Answer to Location 3:
Show Hidden Folders: Ctrl + H
Folder: /home/myname/.java/.userPrefs/com/sample/highimpact
Source: jME3 Application Display Settings :: jMonkeyEngine Docs

Answer to Location 1:
I think this is never triggered because PrintScreen triggers the OS’s native screeshot utility and minimizes the game.

But If I were able to get around this I think it would store the .png file under .jm3.

One way to find out the location once you get it to save is to name the file to something unique like screenShotState.setFileName(“AAABBBCCC”) then search for "“AAABBBCCC” in the folder. That will lead you to the specific subfolder.

Or debug? :slight_smile:

Or you can just check the source. Only takes a few seconds.

And the reason mine all store in the current working directory is because I tell them too:

new ScreenshotAppState("", System.currentTimeMillis()));

Makes it easier for users to find the screen shot for a particular app/game. (Me, too.)

1 Like

Answer to Location 1:

System.out.println(JmeSystem.getStorageFolder().toString());
shows “/home/myname/.jme3”

That answers all of my questions. Thank you all.

1 Like