style(Async): Adding suffix to async static methods. (#552)

This commit is contained in:
Eric Rozell
2016-10-05 01:19:20 -04:00
committed by Geoffrey Goh
parent ea265bb1e4
commit 032df754f1
4 changed files with 13 additions and 13 deletions

View File

@@ -10,7 +10,7 @@ namespace CodePush.ReactNative
{
internal class CodePushUtils
{
internal async static Task<JObject> GetJObjectFromFile(StorageFile file)
internal async static Task<JObject> GetJObjectFromFileAsync(StorageFile file)
{
string jsonString = await FileIO.ReadTextAsync(file);
if (jsonString.Length == 0)

View File

@@ -6,7 +6,7 @@ namespace CodePush.ReactNative
{
internal class FileUtils
{
internal async static Task MergeFolders(StorageFolder source, StorageFolder target)
internal async static Task MergeFoldersAsync(StorageFolder source, StorageFolder target)
{
foreach (StorageFile sourceFile in await source.GetFilesAsync())
{
@@ -16,7 +16,7 @@ namespace CodePush.ReactNative
foreach (StorageFolder sourceDirectory in await source.GetFoldersAsync())
{
StorageFolder nextTargetSubDir = await target.CreateFolderAsync(sourceDirectory.Name, CreationCollisionOption.OpenIfExists);
await MergeFolders(sourceDirectory, nextTargetSubDir);
await MergeFoldersAsync(sourceDirectory, nextTargetSubDir);
}
}
}

View File

@@ -67,16 +67,16 @@ namespace CodePush.ReactNative
throw new InvalidDataException("Received a diff update, but there is no current version to diff against.");
}
await UpdateUtils.CopyNecessaryFilesFromCurrentPackage(diffManifestFile, currentPackageFolder, newUpdateFolder);
await UpdateUtils.CopyNecessaryFilesFromCurrentPackageAsync(diffManifestFile, currentPackageFolder, newUpdateFolder);
await diffManifestFile.DeleteAsync();
}
await FileUtils.MergeFolders(unzippedFolder, newUpdateFolder);
await FileUtils.MergeFoldersAsync(unzippedFolder, newUpdateFolder);
await unzippedFolder.DeleteAsync();
// For zip updates, we need to find the relative path to the jsBundle and save it in the
// metadata so that we can find and run it easily the next time.
string relativeBundlePath = await UpdateUtils.FindJSBundleInUpdateContents(newUpdateFolder, expectedBundleFileName);
string relativeBundlePath = await UpdateUtils.FindJSBundleInUpdateContentsAsync(newUpdateFolder, expectedBundleFileName);
if (relativeBundlePath == null)
{
throw new InvalidDataException("Update is invalid - A JS bundle file named \"" + expectedBundleFileName + "\" could not be found within the downloaded contents. Please check that you are releasing your CodePush updates using the exact same JS bundle file name that was shipped with your app's binary.");
@@ -149,7 +149,7 @@ namespace CodePush.ReactNative
try
{
StorageFile packageFile = await packageFolder.GetFileAsync(CodePushConstants.PackageFileName);
return await CodePushUtils.GetJObjectFromFile(packageFile);
return await CodePushUtils.GetJObjectFromFileAsync(packageFile);
}
catch (IOException)
{
@@ -258,7 +258,7 @@ namespace CodePush.ReactNative
private async Task<JObject> GetCurrentPackageInfoAsync()
{
StorageFile statusFile = await GetStatusFileAsync();
return await CodePushUtils.GetJObjectFromFile(statusFile);
return await CodePushUtils.GetJObjectFromFileAsync(statusFile);
}
private async Task<StorageFile> GetDownloadFileAsync()

View File

@@ -8,10 +8,10 @@ namespace CodePush.ReactNative
{
internal class UpdateUtils
{
internal async static Task CopyNecessaryFilesFromCurrentPackage(StorageFile diffManifestFile, StorageFolder currentPackageFolder, StorageFolder newPackageFolder)
internal async static Task CopyNecessaryFilesFromCurrentPackageAsync(StorageFile diffManifestFile, StorageFolder currentPackageFolder, StorageFolder newPackageFolder)
{
await FileUtils.MergeFolders(currentPackageFolder, newPackageFolder);
JObject diffManifest = await CodePushUtils.GetJObjectFromFile(diffManifestFile);
await FileUtils.MergeFoldersAsync(currentPackageFolder, newPackageFolder);
JObject diffManifest = await CodePushUtils.GetJObjectFromFileAsync(diffManifestFile);
var deletedFiles = (JArray)diffManifest["deletedFiles"];
foreach (string fileNameToDelete in deletedFiles)
{
@@ -20,7 +20,7 @@ namespace CodePush.ReactNative
}
}
internal async static Task<string> FindJSBundleInUpdateContents(StorageFolder updateFolder, string expectedFileName)
internal async static Task<string> FindJSBundleInUpdateContentsAsync(StorageFolder updateFolder, string expectedFileName)
{
foreach (StorageFile file in await updateFolder.GetFilesAsync())
{
@@ -33,7 +33,7 @@ namespace CodePush.ReactNative
foreach (StorageFolder folder in await updateFolder.GetFoldersAsync())
{
string mainBundlePathInSubFolder = await FindJSBundleInUpdateContents(folder, expectedFileName);
string mainBundlePathInSubFolder = await FindJSBundleInUpdateContentsAsync(folder, expectedFileName);
if (mainBundlePathInSubFolder != null)
{
return Path.Combine(folder.Name, mainBundlePathInSubFolder);