Moved log path definition to FileStorageUtils

This commit is contained in:
David A. Velasco 2013-04-15 13:32:49 +02:00
parent 274dfd2958
commit 1003ecb7be
3 changed files with 6 additions and 3 deletions

View file

@ -23,7 +23,6 @@ import java.util.ArrayList;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.preference.Preference; import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener; import android.preference.Preference.OnPreferenceChangeListener;
import android.view.View; import android.view.View;
@ -36,11 +35,12 @@ import com.actionbarsherlock.app.SherlockPreferenceActivity;
import com.actionbarsherlock.view.MenuItem; import com.actionbarsherlock.view.MenuItem;
import com.owncloud.android.R; import com.owncloud.android.R;
import com.owncloud.android.ui.adapter.LogListAdapter; import com.owncloud.android.ui.adapter.LogListAdapter;
import com.owncloud.android.utils.FileStorageUtils;
public class LogHistoryActivity extends SherlockPreferenceActivity implements OnPreferenceChangeListener { public class LogHistoryActivity extends SherlockPreferenceActivity implements OnPreferenceChangeListener {
String logpath = Environment.getExternalStorageDirectory()+File.separator+"owncloud"+File.separator+"log"; String logpath = FileStorageUtils.getLogPath();
File logDIR = null; File logDIR = null;
@Override @Override

View file

@ -33,7 +33,6 @@ import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener; import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener; import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.util.Log;
import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockPreferenceActivity; import com.actionbarsherlock.app.SherlockPreferenceActivity;

View file

@ -66,6 +66,10 @@ public class FileStorageUtils {
} }
public static final String getLogPath() {
return Environment.getExternalStorageDirectory() + File.separator + "owncloud" + File.separator + "log";
}
// to ensure we will not add the slash twice between filename and // to ensure we will not add the slash twice between filename and
// folder-name // folder-name
private static String getFileName(String filepath) { private static String getFileName(String filepath) {