Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
39b7dbec
Commit
39b7dbec
authored
Sep 10, 2021
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索结果卡片排序
parent
aa3f3f4d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
135 additions
and
142 deletions
+135
-142
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
+3
-7
mobile/src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
.../src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
+27
-51
mobile/src/main/java/cn/garymb/ygomobile/loader/ICardLoader.java
...src/main/java/cn/garymb/ygomobile/loader/ICardLoader.java
+9
-8
mobile/src/main/java/cn/garymb/ygomobile/utils/CardSort.java
mobile/src/main/java/cn/garymb/ygomobile/utils/CardSort.java
+83
-73
mobile/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
...le/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
+13
-3
No files found.
mobile/src/main/java/cn/garymb/ygomobile/bean/DeckInfo.java
View file @
39b7dbec
...
@@ -255,10 +255,6 @@ public class DeckInfo {
...
@@ -255,10 +255,6 @@ public class DeckInfo {
}
}
}
}
private
boolean
comp
(
Card
c1
,
Card
c2
)
{
return
CardSort
.
ASC
.
compare
(
c1
,
c2
)
<
0
;
}
public
void
sortAll
()
{
public
void
sortAll
()
{
sortMain
();
sortMain
();
sortExtra
();
sortExtra
();
...
@@ -281,9 +277,9 @@ public class DeckInfo {
...
@@ -281,9 +277,9 @@ public class DeckInfo {
int
len
=
cards
.
size
();
int
len
=
cards
.
size
();
for
(
int
i
=
0
;
i
<
len
-
1
;
i
++)
{
for
(
int
i
=
0
;
i
<
len
-
1
;
i
++)
{
for
(
int
j
=
0
;
j
<
len
-
1
-
i
;
j
++)
{
for
(
int
j
=
0
;
j
<
len
-
1
-
i
;
j
++)
{
Card
d
1
=
cards
.
get
(
j
);
Card
c
1
=
cards
.
get
(
j
);
Card
d
2
=
cards
.
get
(
j
+
1
);
Card
c
2
=
cards
.
get
(
j
+
1
);
if
(
comp
(
d1
,
d2
)
)
{
if
(
CardSort
.
FULL_ASC
.
compare
(
c1
,
c2
)
>
0
)
{
Collections
.
swap
(
cards
,
j
,
j
+
1
);
Collections
.
swap
(
cards
,
j
,
j
+
1
);
}
}
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/loader/CardLoader.java
View file @
39b7dbec
...
@@ -17,20 +17,20 @@ import cn.garymb.ygomobile.Constants;
...
@@ -17,20 +17,20 @@ import cn.garymb.ygomobile.Constants;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
import
cn.garymb.ygomobile.ui.plus.VUiKit
;
import
cn.garymb.ygomobile.utils.CardSort
;
import
ocgcore.CardManager
;
import
ocgcore.CardManager
;
import
ocgcore.DataManager
;
import
ocgcore.DataManager
;
import
ocgcore.LimitManager
;
import
ocgcore.LimitManager
;
import
ocgcore.StringManager
;
import
ocgcore.StringManager
;
import
ocgcore.data.Card
;
import
ocgcore.data.Card
;
import
ocgcore.data.LimitList
;
import
ocgcore.data.LimitList
;
import
ocgcore.enums.CardType
;
import
ocgcore.enums.LimitType
;
import
ocgcore.enums.LimitType
;
public
class
CardLoader
implements
ICard
Load
er
{
public
class
CardLoader
implements
ICard
Search
er
{
private
LimitManager
mLimitManager
;
private
final
LimitManager
mLimitManager
;
private
CardManager
mCardManager
;
private
final
CardManager
mCardManager
;
private
StringManager
mStringManager
;
private
final
StringManager
mStringManager
;
private
Context
context
;
private
final
Context
context
;
private
CallBack
mCallBack
;
private
CallBack
mCallBack
;
private
LimitList
mLimitList
;
private
LimitList
mLimitList
;
private
static
final
String
TAG
=
CardLoader
.
class
.
getSimpleName
();
private
static
final
String
TAG
=
CardLoader
.
class
.
getSimpleName
();
...
@@ -62,11 +62,8 @@ public class CardLoader implements ICardLoader {
...
@@ -62,11 +62,8 @@ public class CardLoader implements ICardLoader {
}
}
}
}
@Override
public
SparseArray
<
Card
>
readCards
(
List
<
Integer
>
ids
,
boolean
isSorted
)
{
public
SparseArray
<
Card
>
readCards
(
List
<
Integer
>
ids
,
boolean
isSorted
)
{
return
readCards
(
ids
,
mLimitList
,
isSorted
);
}
public
SparseArray
<
Card
>
readCards
(
List
<
Integer
>
ids
,
LimitList
limitList
,
boolean
isSorted
)
{
if
(!
isOpen
())
{
if
(!
isOpen
())
{
return
null
;
return
null
;
}
}
...
@@ -84,6 +81,7 @@ public class CardLoader implements ICardLoader {
...
@@ -84,6 +81,7 @@ public class CardLoader implements ICardLoader {
return
map
;
return
map
;
}
}
@Override
public
boolean
isOpen
()
{
public
boolean
isOpen
()
{
return
mCardManager
.
getCount
()
>
0
;
return
mCardManager
.
getCount
()
>
0
;
}
}
...
@@ -127,34 +125,16 @@ public class CardLoader implements ICardLoader {
...
@@ -127,34 +125,16 @@ public class CardLoader implements ICardLoader {
}
}
Dialog
wait
=
DialogPlus
.
show
(
context
,
null
,
context
.
getString
(
R
.
string
.
searching
));
Dialog
wait
=
DialogPlus
.
show
(
context
,
null
,
context
.
getString
(
R
.
string
.
searching
));
VUiKit
.
defer
().
when
(()
->
{
VUiKit
.
defer
().
when
(()
->
{
List
<
Card
>
tmp
=
new
ArrayList
<
Card
>();
List
<
Card
>
monster
=
new
ArrayList
<
Card
>();
List
<
Card
>
spell
=
new
ArrayList
<
Card
>();
List
<
Card
>
trap
=
new
ArrayList
<
Card
>();
SparseArray
<
Card
>
cards
=
mCardManager
.
getAllCards
();
SparseArray
<
Card
>
cards
=
mCardManager
.
getAllCards
();
int
count
=
cards
.
size
();
List
<
Card
>
list
=
new
ArrayList
<>
();
for
(
int
i
=
0
;
i
<
c
ount
;
i
++)
{
for
(
int
i
=
0
;
i
<
c
ards
.
size
()
;
i
++)
{
Card
card
=
cards
.
valueAt
(
i
);
Card
card
=
cards
.
valueAt
(
i
);
if
(
searchInfo
==
null
||
searchInfo
.
check
(
card
))
{
if
(
searchInfo
==
null
||
searchInfo
.
check
(
card
))
{
if
(
searchInfo
!=
null
&&
card
.
Name
.
equalsIgnoreCase
(
searchInfo
.
keyWord1
))
{
list
.
add
(
card
);
tmp
.
add
(
card
);
}
else
if
(
card
.
isType
(
CardType
.
Monster
))
{
monster
.
add
(
card
);
}
else
if
(
card
.
isType
(
CardType
.
Spell
))
{
spell
.
add
(
card
);
}
else
if
(
card
.
isType
(
CardType
.
Trap
))
{
trap
.
add
(
card
);
}
}
}
}
}
Collections
.
sort
(
tmp
,
ASCode
);
Collections
.
sort
(
list
,
CardSort
.
ASC
);
Collections
.
sort
(
monster
,
ASC
);
return
list
;
Collections
.
sort
(
spell
,
ASCode
);
Collections
.
sort
(
trap
,
ASCode
);
tmp
.
addAll
(
monster
);
tmp
.
addAll
(
spell
);
tmp
.
addAll
(
trap
);
return
tmp
;
}).
fail
((
e
)
->
{
}).
fail
((
e
)
->
{
if
(
mCallBack
!=
null
)
{
if
(
mCallBack
!=
null
)
{
ArrayList
<
Card
>
noting
=
new
ArrayList
<
Card
>();
ArrayList
<
Card
>
noting
=
new
ArrayList
<
Card
>();
...
@@ -170,27 +150,23 @@ public class CardLoader implements ICardLoader {
...
@@ -170,27 +150,23 @@ public class CardLoader implements ICardLoader {
});
});
}
}
private
Comparator
<
Card
>
ASCode
=
new
Comparator
<
Card
>()
{
@Override
@Override
public
List
<
Card
>
sort
(
List
<
Card
>
cards
){
public
int
compare
(
Card
o1
,
Card
o2
)
{
Collections
.
sort
(
cards
,
CardSort
.
ASC
);
int
index1
=
(
Integer
.
valueOf
(
o1
.
Code
).
intValue
());
return
cards
;
int
index2
=
(
Integer
.
valueOf
(
o2
.
Code
).
intValue
());
}
return
index1
-
index2
;
}
};
private
Comparator
<
Card
>
ASC
=
new
Comparator
<
Card
>()
{
private
static
final
Comparator
<
Card
>
ASCode
=
(
o1
,
o2
)
->
o1
.
Code
-
o2
.
Code
;
@Override
public
int
compare
(
Card
o1
,
Card
o2
)
{
private
static
final
Comparator
<
Card
>
ASC
=
(
o1
,
o2
)
->
{
if
(
o1
.
getStar
()
==
o2
.
getStar
())
{
if
(
o1
.
getStar
()
==
o2
.
getStar
())
{
if
(
o1
.
Attack
==
o2
.
Attack
)
{
if
(
o1
.
Attack
==
o2
.
Attack
)
{
return
(
int
)
(
o2
.
Code
-
o1
.
Code
);
return
(
int
)
(
o2
.
Code
-
o1
.
Code
);
}
else
{
return
o2
.
Attack
-
o1
.
Attack
;
}
}
else
{
}
else
{
return
o2
.
getStar
()
-
o1
.
getStar
()
;
return
o2
.
Attack
-
o1
.
Attack
;
}
}
}
else
{
return
o2
.
getStar
()
-
o1
.
getStar
();
}
}
};
};
...
...
mobile/src/main/java/cn/garymb/ygomobile/loader/ICardLoader.java
View file @
39b7dbec
package
cn.garymb.ygomobile.loader
;
package
cn.garymb.ygomobile.loader
;
import
android.util.SparseArray
;
import
java.util.List
;
import
ocgcore.data.Card
;
import
ocgcore.data.LimitList
;
import
ocgcore.data.LimitList
;
public
interface
ICardLoader
{
public
interface
ICardLoader
{
void
search
(
String
prefixWord
,
String
suffixWord
,
List
<
Card
>
sort
(
List
<
Card
>
cards
);
long
attribute
,
long
level
,
long
race
,
String
limitName
,
long
limit
,
boolean
isOpen
();
String
atk
,
String
def
,
long
pscale
,
SparseArray
<
Card
>
readCards
(
List
<
Integer
>
ids
,
boolean
isSorted
);
long
setcode
,
long
category
,
long
ot
,
int
link
,
long
...
types
);
void
onReset
();
void
setLimitList
(
LimitList
limit
);
LimitList
getLimitList
();
}
}
mobile/src/main/java/cn/garymb/ygomobile/utils/CardSort.java
View file @
39b7dbec
...
@@ -7,15 +7,50 @@ import ocgcore.enums.CardType;
...
@@ -7,15 +7,50 @@ import ocgcore.enums.CardType;
public
class
CardSort
implements
Comparator
<
Card
>
{
public
class
CardSort
implements
Comparator
<
Card
>
{
public
static
final
CardSort
ASC
=
new
CardSort
();
public
static
final
CardSort
ASC
=
new
CardSort
(
false
);
public
static
final
CardSort
FULL_ASC
=
new
CardSort
(
true
);
public
CardSort
()
{
private
final
boolean
full
;
private
CardSort
(
boolean
full
)
{
this
.
full
=
full
;
}
}
private
int
comp
(
long
l1
,
long
l2
)
{
private
int
comp
(
long
l1
,
long
l2
)
{
if
(
l1
==
l2
)
return
0
;
return
Long
.
compare
(
l1
,
l2
);
if
(
l1
>
l2
)
return
1
;
}
return
-
1
;
private
static
final
int
SORT_OTHER
=
999
;
private
static
final
int
SORT_MONSTER
=
1
;
private
static
final
int
SORT_LINK
=
2
;
private
static
final
int
SORT_SPELL
=
3
;
private
static
final
int
SORT_TRAP
=
4
;
private
static
final
int
SORT_FUSION
=
10
;
private
static
final
int
SORT_SYNCHRO
=
11
;
private
static
final
int
SORT_XYZ
=
12
;
private
int
getSortKey1
(
Card
c1
){
if
(
c1
.
isType
(
CardType
.
Link
))
{
return
SORT_LINK
;
}
else
if
(
c1
.
isType
(
CardType
.
Monster
))
{
return
SORT_MONSTER
;
}
else
if
(
c1
.
isType
(
CardType
.
Spell
))
{
return
SORT_SPELL
;
}
else
if
(
c1
.
isType
(
CardType
.
Trap
))
{
return
SORT_TRAP
;
}
else
{
return
SORT_OTHER
;
}
}
private
int
getSortKey2
(
Card
c1
){
if
(
c1
.
isType
(
CardType
.
Fusion
))
{
return
SORT_FUSION
;
}
else
if
(
c1
.
isType
(
CardType
.
Synchro
))
{
return
SORT_SYNCHRO
;
}
else
if
(
c1
.
isType
(
CardType
.
Xyz
))
{
return
SORT_XYZ
;
}
else
{
return
SORT_OTHER
;
}
}
}
@Override
@Override
...
@@ -26,89 +61,56 @@ public class CardSort implements Comparator<Card> {
...
@@ -26,89 +61,56 @@ public class CardSort implements Comparator<Card> {
if
(
c2
==
null
)
{
if
(
c2
==
null
)
{
return
1
;
return
1
;
}
}
// boolean log = c1.Code == 74003290||c2.Code == 74003290;
//同名卡
if
(
c1
.
isType
(
CardType
.
Spell
))
{
if
(
c1
.
isAlias
(
c2
)){
if
(
c2
.
isType
(
CardType
.
Monster
))
{
return
comp
(
c1
.
Code
,
c2
.
Code
);
//怪兽在前面
}
return
-
1
;
int
sortKey1
=
getSortKey1
(
c1
);
}
int
sortKey2
=
getSortKey1
(
c2
);
if
(
c2
.
isType
(
CardType
.
Trap
))
{
if
(
sortKey1
!=
sortKey2
){
//陷阱在前面
return
Integer
.
compare
(
sortKey1
,
sortKey2
);
return
1
;
}
}
if
(
sortKey1
==
SORT_SPELL
||
sortKey2
==
SORT_TRAP
){
long
type1
=
c1
.
Type
^
CardType
.
Spell
.
value
();
long
type1
,
type2
;
long
type2
=
c2
.
Type
^
CardType
.
Spell
.
value
();
if
(
sortKey1
==
SORT_SPELL
){
int
rs
=
comp
(
type1
,
type2
);
type1
=
c1
.
Type
^
CardType
.
Spell
.
getId
();
if
(
rs
==
0
)
{
type2
=
c2
.
Type
^
CardType
.
Spell
.
getId
();
return
comp
(
c1
.
Code
,
c2
.
Code
);
}
else
{
}
else
{
return
rs
;
type1
=
c1
.
Type
^
CardType
.
Trap
.
getId
();
type2
=
c2
.
Type
^
CardType
.
Trap
.
getId
();
}
}
}
else
if
(
c1
.
isType
(
CardType
.
Trap
))
{
//怪兽魔法在前面
if
(
c2
.
isType
(
CardType
.
Monster
)
||
c2
.
isType
(
CardType
.
Spell
))
{
return
-
1
;
}
long
type1
=
c1
.
Type
^
CardType
.
Trap
.
value
();
long
type2
=
c2
.
Type
^
CardType
.
Trap
.
value
();
int
rs
=
comp
(
type1
,
type2
);
int
rs
=
comp
(
type1
,
type2
);
if
(
rs
==
0
)
{
if
(
rs
==
0
)
{
return
comp
(
c1
.
Code
,
c2
.
Code
);
return
comp
(
c1
.
Code
,
c2
.
Code
);
}
else
{
}
else
{
return
rs
;
return
rs
;
}
}
}
else
if
(
c1
.
isType
(
CardType
.
Monster
))
{
}
else
if
(
sortKey1
==
SORT_OTHER
){
//魔法陷阱在后面
return
comp
(
c1
.
Code
,
c2
.
Code
);
if
(
c2
.
isType
(
CardType
.
Spell
))
{
// } else if(sortKey1 == SORT_LINK){
//怪兽在前面
// return Integer.compare(c2.getStar(), c1.getStar());
return
1
;
}
else
{
}
//monster
if
(
c2
.
isType
(
CardType
.
Trap
))
{
if
(
full
)
{
//陷阱在前面
sortKey1
=
getSortKey2
(
c1
);
return
2
;
sortKey2
=
getSortKey2
(
c2
);
}
if
(
sortKey1
!=
sortKey2
)
{
//需要反转
//超量,同调,融合
return
Integer
.
compare
(
sortKey1
,
sortKey2
);
//1,2,3
if
(
c1
.
isType
(
CardType
.
Xyz
))
{
if
(
c2
.
isType
(
CardType
.
Synchro
))
{
return
-
1
;
}
if
(
c2
.
isType
(
CardType
.
Fusion
))
{
return
-
2
;
}
if
(
c2
.
isType
(
CardType
.
Link
))
{
return
1
;
}
}
else
if
(
c1
.
isType
(
CardType
.
Synchro
))
{
if
(
c2
.
isType
(
CardType
.
Xyz
))
{
return
1
;
}
if
(
c2
.
isType
(
CardType
.
Fusion
))
{
return
-
1
;
}
if
(
c2
.
isType
(
CardType
.
Link
))
{
return
2
;
}
}
else
if
(
c1
.
isType
(
CardType
.
Fusion
))
{
if
(
c2
.
isType
(
CardType
.
Xyz
))
{
return
2
;
}
if
(
c2
.
isType
(
CardType
.
Synchro
))
{
return
1
;
}
if
(
c2
.
isType
(
CardType
.
Link
))
{
return
3
;
}
}
}
}
int
rs
=
comp
(
c1
.
getStar
(),
c2
.
getStar
());
//高星的在前面
int
rs
=
comp
(
c2
.
getStar
(),
c1
.
getStar
());
if
(
rs
!=
0
)
{
if
(
rs
!=
0
)
{
return
rs
;
return
rs
;
}
}
rs
=
comp
(
c1
.
Attack
,
c2
.
Attack
);
//高攻击的在前面
rs
=
comp
(
c2
.
Attack
,
c1
.
Attack
);
if
(
rs
!=
0
)
{
if
(
rs
!=
0
)
{
return
rs
;
return
rs
;
}
}
rs
=
comp
(
c1
.
Defense
,
c2
.
Defense
);
//高防御的在前面
rs
=
comp
(
c2
.
Defense
,
c1
.
Defense
);
if
(
rs
!=
0
)
{
if
(
rs
!=
0
)
{
return
rs
;
return
rs
;
}
}
...
@@ -128,4 +130,12 @@ public class CardSort implements Comparator<Card> {
...
@@ -128,4 +130,12 @@ public class CardSort implements Comparator<Card> {
}
}
return
comp
(
c1
.
Code
,
c2
.
Code
);
return
comp
(
c1
.
Code
,
c2
.
Code
);
}
}
private
boolean
isSameType
(
Card
c1
,
Card
c2
,
CardType
type
){
return
c1
.
isType
(
type
)
&&
c2
.
isType
(
type
);
}
private
boolean
isSpecialType
(
Card
c1
)
{
return
c1
.
isType
(
CardType
.
Fusion
)
||
c1
.
isType
(
CardType
.
Synchro
)
||
c1
.
isType
(
CardType
.
Xyz
)
||
c1
.
isType
(
CardType
.
Link
);
}
}
}
mobile/src/main/java/cn/garymb/ygomobile/utils/FileUtils.java
View file @
39b7dbec
...
@@ -4,9 +4,11 @@ import android.content.Context;
...
@@ -4,9 +4,11 @@ import android.content.Context;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.util.Log
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
androidx.core.content.FileProvider
;
import
androidx.core.content.FileProvider
;
import
java.io.BufferedReader
;
import
java.io.BufferedReader
;
import
java.io.Console
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileNotFoundException
;
...
@@ -18,6 +20,8 @@ import java.io.OutputStream;
...
@@ -18,6 +20,8 @@ import java.io.OutputStream;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
cn.garymb.ygomobile.Constants
;
public
class
FileUtils
{
public
class
FileUtils
{
...
@@ -40,6 +44,9 @@ public class FileUtils {
...
@@ -40,6 +44,9 @@ public class FileUtils {
InputStreamReader
in
=
null
;
InputStreamReader
in
=
null
;
FileInputStream
inputStream
=
null
;
FileInputStream
inputStream
=
null
;
List
<
String
>
lines
=
new
ArrayList
<>();
List
<
String
>
lines
=
new
ArrayList
<>();
if
(
encoding
==
null
){
encoding
=
"utf-8"
;
}
try
{
try
{
inputStream
=
new
FileInputStream
(
file
);
inputStream
=
new
FileInputStream
(
file
);
in
=
new
InputStreamReader
(
inputStream
,
encoding
);
in
=
new
InputStreamReader
(
inputStream
,
encoding
);
...
@@ -48,8 +55,8 @@ public class FileUtils {
...
@@ -48,8 +55,8 @@ public class FileUtils {
while
((
line
=
reader
.
readLine
())
!=
null
)
{
while
((
line
=
reader
.
readLine
())
!=
null
)
{
lines
.
add
(
line
);
lines
.
add
(
line
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Throwable
e
)
{
//ignore
}
finally
{
}
finally
{
IOUtils
.
close
(
in
);
IOUtils
.
close
(
in
);
IOUtils
.
close
(
inputStream
);
IOUtils
.
close
(
inputStream
);
...
@@ -58,6 +65,9 @@ public class FileUtils {
...
@@ -58,6 +65,9 @@ public class FileUtils {
}
}
public
static
boolean
writeLines
(
String
file
,
List
<
String
>
lines
,
String
encoding
,
String
newLine
)
{
public
static
boolean
writeLines
(
String
file
,
List
<
String
>
lines
,
String
encoding
,
String
newLine
)
{
if
(
encoding
==
null
){
encoding
=
"utf-8"
;
}
FileOutputStream
outputStream
=
null
;
FileOutputStream
outputStream
=
null
;
File
tmp
=
new
File
(
file
+
".tmp"
);
File
tmp
=
new
File
(
file
+
".tmp"
);
boolean
ok
=
false
;
boolean
ok
=
false
;
...
@@ -115,7 +125,7 @@ public class FileUtils {
...
@@ -115,7 +125,7 @@ public class FileUtils {
outputStream
=
new
FileOutputStream
(
out
);
outputStream
=
new
FileOutputStream
(
out
);
copy
(
inputStream
,
outputStream
);
copy
(
inputStream
,
outputStream
);
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
Log
.
e
(
"ygo"
,
"copy file"
,
e
);
Log
.
e
(
Constants
.
TAG
,
"copy file"
,
e
);
return
false
;
return
false
;
}
finally
{
}
finally
{
IOUtils
.
close
(
outputStream
);
IOUtils
.
close
(
outputStream
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment