com.hipipal.texteditor.common
Class TextFileUtils
java.lang.Object
com.hipipal.texteditor.common.TextFileUtils
- All Implemented Interfaces:
- Constants
public class TextFileUtils
- extends java.lang.Object
- implements Constants
Misc file utilities
TODO code review
Fields inherited from interface com.hipipal.texteditor.common.Constants |
ACTION_WIDGET_OPEN, BACKUP_FILE_NAME, COLOR_CLASSIC, COLOR_DRACULA, COLOR_MATRIX, COLOR_NEGATIVE, COLOR_SKY, ENC_ASCII, ENC_LATIN, ENC_UTF8, EOL_LINUX, EOL_MAC, EOL_WINDOWS, EXTRA_FORCE_READ_ONLY, EXTRA_REQUEST_CODE, FONT_FILE_NAME, FONT_FOLDER_NAME, MENU_ID_ABOUT, MENU_ID_NEW, MENU_ID_OPEN, MENU_ID_OPEN_RECENT, MENU_ID_QUIT, MENU_ID_REDO, MENU_ID_SAVE, MENU_ID_SAVE_AS, MENU_ID_SEARCH, MENU_ID_SETTINGS, MENU_ID_UNDO, PREFERENCE_ALLOW_UNDO, PREFERENCE_AUTO_SAVE, PREFERENCE_AUTO_SAVE_OVERWRITE, PREFERENCE_BACK_BUTTON_AS_UNDO, PREFERENCE_COLOR_THEME, PREFERENCE_ENCODING, PREFERENCE_END_OF_LINES, PREFERENCE_FLING_TO_SCROLL, PREFERENCE_FONT, PREFERENCE_HIGHLIGHT, PREFERENCE_HOME_PAGE_PATH, PREFERENCE_MAX_RECENTS, PREFERENCE_MAX_UNDO_STACK, PREFERENCE_RECENTS, PREFERENCE_SEARCH_MATCH_CASE, PREFERENCE_SEARCHWRAP, PREFERENCE_SELECT_FONT, PREFERENCE_SHOW_LINE_NUMBERS, PREFERENCE_TEXT_SIZE, PREFERENCE_USE_HOME_PAGE, PREFERENCE_WORDWRAP, PREFERENCES_NAME, REQUEST_FONT, REQUEST_HOME_PAGE, REQUEST_OPEN, REQUEST_RECENT, REQUEST_SAVE_AS, RESULT_ERROR, STORAGE, STORAGE_PATH, TAG, TEXT_SIZE_MAX, TEXT_SIZE_MIN |
Method Summary |
static void |
clearInternal(android.content.Context context)
|
static java.lang.String |
readInternal(android.content.Context context)
|
static java.lang.String |
readTextFile(java.io.File file)
|
static boolean |
writeInternal(android.content.Context context,
java.lang.String text)
|
static boolean |
writeTextFile(java.lang.String path,
java.lang.String text)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextFileUtils
public TextFileUtils()
writeTextFile
public static boolean writeTextFile(java.lang.String path,
java.lang.String text)
- Parameters:
path
- the absolute path to the file to savetext
- the text to write
- Returns:
- if the file was saved successfully
readTextFile
public static java.lang.String readTextFile(java.io.File file)
- Parameters:
file
- the file to read
- Returns:
- the content of the file as text
writeInternal
public static boolean writeInternal(android.content.Context context,
java.lang.String text)
- Parameters:
context
- the current contexttext
- the text to write
- Returns:
- if the file was saved successfully
readInternal
public static java.lang.String readInternal(android.content.Context context)
- Parameters:
context
- the current context
- Returns:
- the content of the file as text
clearInternal
public static void clearInternal(android.content.Context context)
- Parameters:
context
- the current context