Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
11 years ago
Diff never expires
Clear
Export
Share
Explain
14 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
124 lines
Copy
4 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
119 lines
Copy
package com.klab.lods.en.utils.file;
package com.klab.lods.en.utils.file;
import java.io.File;
import java.io.File;
import android.content.Context;
import android.content.Context;
import com.klab.lods.en.utils.LDGlobals;
import com.klab.lods.en.utils.LDGlobals;
/**
/**
*
*
* @author shun_nakahara
* @author shun_nakahara
*
*
*/
*/
public class LDFileUtil {
public class LDFileUtil {
Copy
Copied
Copy
Copied
//
F.O.X
man
a
ge file
prefix.
//
Smac
man
ge file
private static final String
FOX_FILE_PREFEX = "__ADMAGE_";
private static final String
SMAC_SES
_FILE = "
sesid.txt
";
private static final String FOX_E
_FILE = "
__e.fox
";
/**
/**
* ファイル名から拡張子を返します。
* ファイル名から拡張子を返します。
* @param fileName ファイル名
* @param fileName ファイル名
* @return ファイルの拡張子
* @return ファイルの拡張子
*/
*/
public static String getSuffix(String fileName) {
public static String getSuffix(String fileName) {
if (fileName == null) {
if (fileName == null) {
return null;
return null;
}
}
int point = fileName.lastIndexOf(".");
int point = fileName.lastIndexOf(".");
if (point == -1) {
if (point == -1) {
return null;
return null;
}
}
return fileName.substring(point + 1);
return fileName.substring(point + 1);
}
}
/**
/**
* ファイル名から拡張子除いたファイル名を返します。
* ファイル名から拡張子除いたファイル名を返します。
* @param fileName ファイル名
* @param fileName ファイル名
* @return 拡張子無しのファイル名
* @return 拡張子無しのファイル名
*/
*/
public static String removeFileExtension(String filename) {
public static String removeFileExtension(String filename) {
if (filename == null) {
if (filename == null) {
return null;
return null;
}
}
int dosPoint = filename.lastIndexOf('.');
int dosPoint = filename.lastIndexOf('.');
if (dosPoint == -1 || dosPoint == 0) {
if (dosPoint == -1 || dosPoint == 0) {
return null;
return null;
} else {
} else {
return filename.substring(0, dosPoint);
return filename.substring(0, dosPoint);
}
}
}
}
/**
/**
* Override this method to change the filename pattern
* Override this method to change the filename pattern
*
*
* @param url The url of the thumbnail.
* @param url The url of the thumbnail.
* @return The generated filename. Default pattern is based on the url:
* @return The generated filename. Default pattern is based on the url:
* pathWithoutSlash_param1value1_param2value2_andSoOn.png
* pathWithoutSlash_param1value1_param2value2_andSoOn.png
*/
*/
public static String getFilename(String url) {
public static String getFilename(String url) {
if (url == null || url.length() == 0) {
if (url == null || url.length() == 0) {
return null;
return null;
}
}
String path = LDGlobals.getApiServerPath();
String path = LDGlobals.getApiServerPath();
if (url.contains(path)) {
if (url.contains(path)) {
url = url.replace(path, "");
url = url.replace(path, "");
}
}
if (url.contains("?")) {
if (url.contains("?")) {
url = url.replace("?", "");
url = url.replace("?", "");
}
}
if (url.contains("=")) {
if (url.contains("=")) {
url = url.replace("=", "");
url = url.replace("=", "");
}
}
if (url.contains("&")) {
if (url.contains("&")) {
url = url.replace("&", "");
url = url.replace("&", "");
}
}
if (url.contains("=")) {
if (url.contains("=")) {
url = url.replace("=", "");
url = url.replace("=", "");
}
}
if (url.contains("/")) {
if (url.contains("/")) {
url = url.replace("/", "");
url = url.replace("/", "");
}
}
if ("".equals(getSuffix(url))) {
if ("".equals(getSuffix(url))) {
return url.trim() + ".png";
return url.trim() + ".png";
}
}
return url.trim();
return url.trim();
}
}
public static void deleteCacheFiles(final Context context) {
public static void deleteCacheFiles(final Context context) {
Runnable runnable = new Runnable() {
Runnable runnable = new Runnable() {
@Override
@Override
public void run() {
public void run() {
File file = context.getFilesDir();
File file = context.getFilesDir();
if (file != null && file.isDirectory()) {
if (file != null && file.isDirectory()) {
File[] filesToBeDeleted = context.getFilesDir().listFiles();
File[] filesToBeDeleted = context.getFilesDir().listFiles();
for (File deleteFile : filesToBeDeleted) {
for (File deleteFile : filesToBeDeleted) {
Copy
Copied
Copy
Copied
if (deleteFile.getName().contains(FOX_FILE_PREFEX)) {
if (
SMAC_SES
_FILE.equals(deleteFile.getName())) {
continue;
}
if (
FOX_E
_FILE.equals(deleteFile.getName())) {
continue;
continue;
}
}
deleteFile.delete();
deleteFile.delete();
}
}
}
}
}
}
};
};
new Thread(runnable).run();
new Thread(runnable).run();
}
}
}
}
Saved diffs
Original text
Open file
package com.klab.lods.en.utils.file; import java.io.File; import android.content.Context; import com.klab.lods.en.utils.LDGlobals; /** * * @author shun_nakahara * */ public class LDFileUtil { // F.O.X manage file prefix. private static final String FOX_FILE_PREFEX = "__ADMAGE_"; private static final String FOX_E_FILE = "__e.fox"; /** * ファイル名から拡張子を返します。 * @param fileName ファイル名 * @return ファイルの拡張子 */ public static String getSuffix(String fileName) { if (fileName == null) { return null; } int point = fileName.lastIndexOf("."); if (point == -1) { return null; } return fileName.substring(point + 1); } /** * ファイル名から拡張子除いたファイル名を返します。 * @param fileName ファイル名 * @return 拡張子無しのファイル名 */ public static String removeFileExtension(String filename) { if (filename == null) { return null; } int dosPoint = filename.lastIndexOf('.'); if (dosPoint == -1 || dosPoint == 0) { return null; } else { return filename.substring(0, dosPoint); } } /** * Override this method to change the filename pattern * * @param url The url of the thumbnail. * @return The generated filename. Default pattern is based on the url: * pathWithoutSlash_param1value1_param2value2_andSoOn.png */ public static String getFilename(String url) { if (url == null || url.length() == 0) { return null; } String path = LDGlobals.getApiServerPath(); if (url.contains(path)) { url = url.replace(path, ""); } if (url.contains("?")) { url = url.replace("?", ""); } if (url.contains("=")) { url = url.replace("=", ""); } if (url.contains("&")) { url = url.replace("&", ""); } if (url.contains("=")) { url = url.replace("=", ""); } if (url.contains("/")) { url = url.replace("/", ""); } if ("".equals(getSuffix(url))) { return url.trim() + ".png"; } return url.trim(); } public static void deleteCacheFiles(final Context context) { Runnable runnable = new Runnable() { @Override public void run() { File file = context.getFilesDir(); if (file != null && file.isDirectory()) { File[] filesToBeDeleted = context.getFilesDir().listFiles(); for (File deleteFile : filesToBeDeleted) { if (deleteFile.getName().contains(FOX_FILE_PREFEX)) { continue; } if (FOX_E_FILE.equals(deleteFile.getName())) { continue; } deleteFile.delete(); } } } }; new Thread(runnable).run(); } }
Changed text
Open file
package com.klab.lods.en.utils.file; import java.io.File; import android.content.Context; import com.klab.lods.en.utils.LDGlobals; /** * * @author shun_nakahara * */ public class LDFileUtil { // Smac mange file private static final String SMAC_SES_FILE = "sesid.txt"; /** * ファイル名から拡張子を返します。 * @param fileName ファイル名 * @return ファイルの拡張子 */ public static String getSuffix(String fileName) { if (fileName == null) { return null; } int point = fileName.lastIndexOf("."); if (point == -1) { return null; } return fileName.substring(point + 1); } /** * ファイル名から拡張子除いたファイル名を返します。 * @param fileName ファイル名 * @return 拡張子無しのファイル名 */ public static String removeFileExtension(String filename) { if (filename == null) { return null; } int dosPoint = filename.lastIndexOf('.'); if (dosPoint == -1 || dosPoint == 0) { return null; } else { return filename.substring(0, dosPoint); } } /** * Override this method to change the filename pattern * * @param url The url of the thumbnail. * @return The generated filename. Default pattern is based on the url: * pathWithoutSlash_param1value1_param2value2_andSoOn.png */ public static String getFilename(String url) { if (url == null || url.length() == 0) { return null; } String path = LDGlobals.getApiServerPath(); if (url.contains(path)) { url = url.replace(path, ""); } if (url.contains("?")) { url = url.replace("?", ""); } if (url.contains("=")) { url = url.replace("=", ""); } if (url.contains("&")) { url = url.replace("&", ""); } if (url.contains("=")) { url = url.replace("=", ""); } if (url.contains("/")) { url = url.replace("/", ""); } if ("".equals(getSuffix(url))) { return url.trim() + ".png"; } return url.trim(); } public static void deleteCacheFiles(final Context context) { Runnable runnable = new Runnable() { @Override public void run() { File file = context.getFilesDir(); if (file != null && file.isDirectory()) { File[] filesToBeDeleted = context.getFilesDir().listFiles(); for (File deleteFile : filesToBeDeleted) { if (SMAC_SES_FILE.equals(deleteFile.getName())) { continue; } deleteFile.delete(); } } } }; new Thread(runnable).run(); } }
Find difference