You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
871 B
42 lines
871 B
6 years ago
|
/*
|
||
|
* Copyright (c) 2018-present, Facebook, Inc.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
|
||
|
import android.support.annotation.UiThread;
|
||
|
import java.io.File;
|
||
|
import java.io.IOException;
|
||
|
|
||
|
class StrictModeViolation {
|
||
|
File f;
|
||
|
|
||
|
@UiThread
|
||
|
void violateStrictModeBad() throws IOException {
|
||
|
f.canRead();
|
||
|
f.canWrite();
|
||
|
f.createNewFile();
|
||
|
f.createTempFile("a", "b");
|
||
|
f.delete();
|
||
|
f.getCanonicalPath();
|
||
|
f.getFreeSpace();
|
||
|
f.getTotalSpace();
|
||
|
f.getUsableSpace();
|
||
|
f.isDirectory();
|
||
|
f.isFile();
|
||
|
f.isHidden();
|
||
|
f.lastModified();
|
||
|
f.length();
|
||
|
f.list();
|
||
|
f.listFiles();
|
||
|
f.mkdir();
|
||
|
f.renameTo(f);
|
||
|
f.setExecutable(true);
|
||
|
f.setLastModified(1L);
|
||
|
f.setReadable(true);
|
||
|
f.setReadOnly();
|
||
|
f.setWritable(true);
|
||
|
}
|
||
|
}
|