Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
d4c08d9b
Commit
d4c08d9b
authored
13 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Make sure the directory where to put files actually exists
Bug: 5095140 Change-Id: I764471e54ce0bf6aefe5d604cee97639d5ad0af9
parent
cfca3c63
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
+13
-2
13 additions, 2 deletions
...android/inputmethod/latin/BinaryDictionaryFileDumper.java
with
13 additions
and
2 deletions
java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
+
13
−
2
View file @
d4c08d9b
...
...
@@ -23,6 +23,7 @@ import android.content.res.Resources;
import
android.database.Cursor
;
import
android.net.Uri
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
java.io.File
;
import
java.io.FileInputStream
;
...
...
@@ -40,6 +41,8 @@ import java.util.Locale;
* file from the dictionary provider
*/
public
class
BinaryDictionaryFileDumper
{
private
static
final
String
TAG
=
BinaryDictionaryFileDumper
.
class
.
getSimpleName
();
/**
* The size of the temporary buffer to copy files.
*/
...
...
@@ -79,8 +82,16 @@ public class BinaryDictionaryFileDumper {
* Find out the cache directory associated with a specific locale.
*/
private
static
String
getCacheDirectoryForLocale
(
Locale
locale
,
Context
context
)
{
final
String
directoryName
=
replaceFileNameDangerousCharacters
(
locale
.
toString
());
return
context
.
getFilesDir
()
+
File
.
separator
+
directoryName
;
final
String
relativeDirectoryName
=
replaceFileNameDangerousCharacters
(
locale
.
toString
());
final
String
absoluteDirectoryName
=
context
.
getFilesDir
()
+
File
.
separator
+
relativeDirectoryName
;
final
File
directory
=
new
File
(
absoluteDirectoryName
);
if
(!
directory
.
exists
())
{
if
(!
directory
.
mkdirs
())
{
Log
.
e
(
TAG
,
"Could not create the directory for locale"
+
locale
);
}
}
return
absoluteDirectoryName
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment