public class BalFileGenerationUtils extends Object
| Constructor and Description |
|---|
BalFileGenerationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
createMetaFolder(String folderPath)
Create meta folder for storing meta files which is used in intermediate processing.
|
static void |
delete(File file)
Used to clear the temporary files.
|
static void |
generateDescriptor(String command)
Execute command and generate file descriptor.
|
static String |
getDescriptorPath(String protoPath)
Build descriptor path using dependent proto path.
|
static byte[] |
getProtoByteArray(String exePath,
String protoPath,
String descriptorPath)
Generate proto file and convert it to byte array.
|
static void |
grantPermission(File file)
Grant permission to the protoc executor file.
|
static boolean |
isWindows() |
static String |
resolveProtoFloderPath(String protoPath)
Resolve proto folder path from Proto file path.
|
static String |
resolveProtoFolderPath(String protoPath)
Resolve proto folder path from Proto file path.
|
static void |
saveFile(URL url,
String file)
Save generated intermediate files.
|
public static void createMetaFolder(String folderPath)
folderPath - folder path which is needed to be created.public static void generateDescriptor(String command)
command - protoc executor command.public static String getDescriptorPath(String protoPath)
protoPath - dependent protoPathpublic static String resolveProtoFloderPath(String protoPath)
protoPath - Proto file pathpublic static byte[] getProtoByteArray(String exePath, String protoPath, String descriptorPath)
exePath - protoc executor pathprotoPath - .proto file pathdescriptorPath - file descriptor path.public static void delete(File file)
file - file to be deletedpublic static void saveFile(URL url, String file)
url - file URLfile - destination file locationpublic static void grantPermission(File file)
file - protoc executor file.public static String resolveProtoFolderPath(String protoPath)
protoPath - Proto file pathpublic static boolean isWindows()
Copyright © 2019 WSO2. All rights reserved.