-
Notifications
You must be signed in to change notification settings - Fork 6
/
PlayerData.java
36 lines (29 loc) · 1.02 KB
/
PlayerData.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package potplayer;
import potplayer.FileDialog;
import potplayer.FileStreams;
/**
* if (FileStreams.mkdir("./src/potplayer/data") == true) {
* FileStreams fileIo = new FileStreams("./src/potplayer/data/setting.play");
* fileIo.writeFiles("C:\example\com\java\video\hello.mp4");
* String names = fileIo.readFile();
* names = fileDialog.readFilePath(names);
* names = names.replaceAll("\\\\", "/");
*
* System.out.println(names);
* }
*/
public class PlayerData {
public void savePlayedFileName(String path, String content) {
FileDialog fileDialog = new FileDialog();
// Check if the directory exists
if (FileStreams.mkdir(fileDialog.readFilePath(path)) == true) {
FileStreams saveFile = new FileStreams(path);
saveFile.writeFiles(content);
}
}
public int getFileTotalNumOfRow(String filePath) {
// Check if the directory exists
int rows = FileStreams.totalNumberOfRows(filePath);
return rows;
}
}