DetectCoreDirectoryFragment: Fix indentation

Also make a class function private.
This commit is contained in:
Lioncash 2014-11-06 10:24:53 -05:00
parent a20ad7d88b
commit 0300d7d840

View File

@ -77,14 +77,14 @@ public final class DetectCoreDirectoryFragment extends DirectoryFragment
/** /**
* Returns everything after the last . of the given file name or path. * Returns everything after the last . of the given file name or path.
*/ */
public static String getFileExt(String filePath) private static String getFileExt(String filePath)
{ {
int i = filePath.lastIndexOf('.'); int i = filePath.lastIndexOf('.');
if (i >= 0) if (i >= 0)
return filePath.substring(i+1).toLowerCase(); return filePath.substring(i+1).toLowerCase();
return ""; // No extension return ""; // No extension
} }
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{ {
@ -188,24 +188,24 @@ public final class DetectCoreDirectoryFragment extends DirectoryFragment
{ {
try try
{ {
ZipFile zipFile = new ZipFile(chosenFile); ZipFile zipFile = new ZipFile(chosenFile);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
// Try to handle the case of small text files bundles with content. Enumeration<? extends ZipEntry> entries = zipFile.entries();
long largestEntry = Long.MIN_VALUE;
while (entries.hasMoreElements()) // Try to handle the case of small text files bundles with content.
{ long largestEntry = Long.MIN_VALUE;
ZipEntry zipEntry = entries.nextElement();
if (zipEntry.getCompressedSize() >= largestEntry) while (entries.hasMoreElements())
{ {
largestEntry = zipEntry.getCompressedSize(); ZipEntry zipEntry = entries.nextElement();
fileExt = getFileExt(zipEntry.getName()); if (zipEntry.getCompressedSize() >= largestEntry)
} {
} largestEntry = zipEntry.getCompressedSize();
fileExt = getFileExt(zipEntry.getName());
zipFile.close(); }
}
zipFile.close();
} }
catch(IOException e) catch(IOException e)
{ {