Change the default file transfer save path

Description

Currently if someone logs in into Spark for the first time with say username john@server, then file saving path would be set to \Spark\user\john@server\. If then he logs out and login with different username, the path will stay the same.

This seems as wrong, but it is the same preferences file for every xmpp account you login as long as you are logged with one account in your OS. So changing the same preferences file every time you login with different xmpp account is unlogical and preserving previous changes is complicated, or this will involve altering the whole process how Spark is managing different xmpp accounts and settings for them for the one OS user.

Another option would be to use OS specific paths for saving files like AppData\User\Downloads folders in Windows and /Home/User/Downloads in Ubuntu (linux), probably something similar in Mac OS X. This means, that all downloads will go to the same folder for all xmpp usernames (by default) and if it is changed to some other location, then it should be the same for all the xmpp accounts.

The common paradigm is that only one person should use one OS account, so i think having same folder to save files for every xmpp account that person logs in is ok. Just the current path is not fitting.

Environment

None

Activity

Show:
Walter Ebeling
June 22, 2011, 6:02 PM

Mass closing of all bugs resoved during 2.6.0 and 2.6.1

Konstantin Zolotarev
March 4, 2011, 6:39 AM
Edited

Worked. Error really was with backslashes. Linux & mac uses "/" char except of "\"

Patch in svn

Wolf P.
March 2, 2011, 7:26 AM
Edited

it could be related to the double backslash and case sensitivity of linux

try these two in java/org/jivesoftware/sparkimpl/settings/local/LocalPreferences.java
1.
if (Spark.isLinux() || Spark.isMac()) {

downloadedDir = new File(System.getProperty("user.home") + "/Downloads/");

}

2.

if (Spark.isLinux() || Spark.isMac()) {

downloadedDir = new File(System.getProperty("user.home") + "/downloads/");

}

Konstantin Zolotarev
March 1, 2011, 12:47 PM
Edited

Same. (Linux)
I think this is smack issue.

01.03.2011 18:46:54 org.jivesoftware.spark.util.log.Log error
SEVERE:
Could not create file to write too:
– caused by: java.io.IOException: No such file or directory
at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.recieveFile(IncomingFileTransfer.java:109)
at org.jivesoftware.sparkimpl.plugin.filetransfer.transfer.ui.ReceiveMessage$5.construct(ReceiveMessage.java:241)
at org.jivesoftware.spark.util.SwingWorker$2.run(SwingWorker.java:141)
at java.lang.Thread.run(Unknown Source)
Nested Exception:
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at org.jivesoftware.smackx.filetransfer.IncomingFileTransfer.recieveFile(IncomingFileTransfer.java:106)
at org.jivesoftware.sparkimpl.plugin.filetransfer.transfer.ui.ReceiveMessage$5.construct(ReceiveMessage.java:241)
at org.jivesoftware.spark.util.SwingWorker$2.run(SwingWorker.java:141)
at java.lang.Thread.run(Unknown Source)

Walter Ebeling
March 1, 2011, 9:07 AM

please review&fix

Fixed

Priority

Minor

Assignee

Wolf P.

Reporter

wroot