Package com.vaadin.copilot
Class ProjectManager
java.lang.Object
com.vaadin.copilot.ProjectManager
Handles reading and writing files in the project
-
Constructor Summary
ConstructorsConstructorDescriptionProjectManager
(ApplicationConfiguration applicationConfiguration) Creates a new project manager -
Method Summary
Modifier and TypeMethodDescriptiongetFileForClass
(Class<?> cls) Returns the Java file for the given class.getFileForClass
(String cls) Returns the Java file for the given class.Returns the frontend folder.Returns the Java source folder.Returns the project root folder.getRelativeName
(File projectFile) Returns the name of the file, relative to the project root.getSourceFile
(ComponentTracker.Location location) Returns the Java file for the given component location.Gets current theme folderGets current theme namemakeAbsolute
(String projectRelativeFilename) makeRelative
(String filename) void
void
-
Constructor Details
-
ProjectManager
Creates a new project manager- Parameters:
applicationConfiguration
- the application configuration- Throws:
IOException
- if the project folder cannot be resolved
-
-
Method Details
-
readFile
- Throws:
IOException
-
readFile
- Throws:
IOException
-
readLines
- Throws:
IOException
-
writeFile
- Throws:
IOException
-
writeFile
- Throws:
IOException
-
makeAbsolute
- Throws:
IOException
-
makeRelative
- Throws:
IOException
-
getRelativeName
Returns the name of the file, relative to the project root.- Parameters:
projectFile
- the file- Returns:
- the relative name of the file
-
getFileForClass
Returns the Java file for the given class.- Parameters:
cls
- the class- Returns:
- the file for the class
-
getFileForClass
Returns the Java file for the given class.- Parameters:
cls
- the class- Returns:
- the file for the class
-
getSourceFile
Returns the Java file for the given component location.- Parameters:
location
- the component location- Returns:
- the file for the class where the component is used
-
getJavaSourceFolder
Returns the Java source folder.- Returns:
- the Java source folder
-
getProjectRoot
Returns the project root folder.- Returns:
- the project root folder
-
getFrontendFolder
Returns the frontend folder.- Returns:
- the frontend folder
-
getThemeName
Gets current theme name- Returns:
- optional theme name
-
getThemeFolder
Gets current theme folder- Returns:
- optional theme folder
-