org.eclipse.wst.jsdt.chromium.debug.core.util

## Class ChromiumDebugPluginUtil

- java.lang.Object
- - org.eclipse.wst.jsdt.chromium.debug.core.util.ChromiumDebugPluginUtil

    public class ChromiumDebugPluginUtil
    extends java.lang.Object

A utility for interaction with the Eclipse workspace.

### Field Summary

Fields
`static Breakpoint.Target.Visitor<java.lang.String>` `BREAKPOINT_TARGET_TO_STRING`
`static java.lang.String` `CHROMIUM_EXTENSION_SUFFIX`
`static java.lang.String` `JS_DEBUG_PROJECT_NATURE`
`static java.util.Set<java.lang.String>` `SUPPORTED_EXTENSIONS`
`static java.util.List<java.lang.String>` `SUPPORTED_EXTENSIONS_SUFFIX_LIST`

### Method Summary

All Methods Static Methods Concrete Methods
`static IProject` `createEmptyProject(java.lang.String projectNameBase)` Creates an empty workspace project with the name starting with the given projectNameBase.
`static IFile` `createFile(IFolder container, java.lang.String filename)` Creates an empty file with the given filename in the given project.
`static IFile` `createFile(IProject container, java.lang.String filename)` Creates an empty file with the given filename in the given project.
`static void` `deleteVirtualProjectAsync(IProject debugProject)` Removes virtual project which was created for debug session.
`static IContainer` `getSourceContainer(IProject project)` The container where the script sources should be put.
`static boolean` `isInteger(java.lang.String value)`
`static void` `openProjectExplorerView()` Brings up the "Project Explorer" view in the active workbench window.
`static boolean` `projectExists(java.lang.String projectName)`
`static byte[]` `readBytes(java.io.InputStream inputStream)`
`static byte[]` `readFileContents(IFile file)`
`static <T> T` `throwUnsupported()`
`static void` `writeFile(IFile file, java.lang.String data)` Writes data into a resource with the given resourceName residing in the source folder of the given project.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### SUPPORTED_EXTENSIONS

    public static final java.util.Set<java.lang.String> SUPPORTED_EXTENSIONS

#### SUPPORTED_EXTENSIONS_SUFFIX_LIST

    public static final java.util.List<java.lang.String> SUPPORTED_EXTENSIONS_SUFFIX_LIST

#### JS_DEBUG_PROJECT_NATURE

    public static final java.lang.String JS_DEBUG_PROJECT_NATURE

See Also:
  Constant Field Values

#### CHROMIUM_EXTENSION_SUFFIX

    public static final java.lang.String CHROMIUM_EXTENSION_SUFFIX

See Also:
  Constant Field Values

#### BREAKPOINT_TARGET_TO_STRING

    public static final Breakpoint.Target.Visitor<java.lang.String> BREAKPOINT_TARGET_TO_STRING

### Method Detail

#### openProjectExplorerView

    public static void openProjectExplorerView()

Brings up the "Project Explorer" view in the active workbench window.

#### createEmptyProject

    public static IProject createEmptyProject(java.lang.String projectNameBase)

Creates an empty workspace project with the name starting with the given projectNameBase. Created project is guaranteed to be new in EFS, but workspace may happen to already have project with such url (left uncleaned from previous runs). Such project silently gets deleted.

Parameters:
  `projectNameBase` - project name template
Returns:
  the newly created project, or `null` if the creation failed

#### deleteVirtualProjectAsync

    public static void deleteVirtualProjectAsync(IProject debugProject)

Removes virtual project which was created for debug session. Does its job asynchronously.

#### projectExists

    public static boolean projectExists(java.lang.String projectName)

Parameters:
  `projectName` - to check for existence
Returns:
  whether the project named projectName exists.

#### createFile

    public static IFile createFile(IProject container,
                                   java.lang.String filename)

Creates an empty file with the given filename in the given project.

Parameters:
  `container` - to create the file in
  `filename` - the base short file name to create (will be sanitized for illegal chars and, in the case of a name clash, suffixed with "(N)")
Returns:
  the result of IFile.getName(), or `null` if the creation has failed

#### createFile

    public static IFile createFile(IFolder container,
                                   java.lang.String filename)

Creates an empty file with the given filename in the given project.

Parameters:
  `container` - to create the file in
  `filename` - the base short file name to create (will be sanitized for illegal chars and, in the case of a name clash, suffixed with "(N)")
Returns:
  the result of IFile.getName(), or `null` if the creation has failed

#### writeFile

    public static void writeFile(IFile file,
                                 java.lang.String data)
                          throws CoreException

Writes data into a resource with the given resourceName residing in the source folder of the given project. The previous file content is lost. Temporarily resets the "read-only" file attribute if one is present.

Parameters:
  `file` - to set contents for
  `data` - to write into the file
Throws:
  `CoreException`

#### isInteger

    public static boolean isInteger(java.lang.String value)

#### getSourceContainer

    public static IContainer getSourceContainer(IProject project)

The container where the script sources should be put.

Parameters:
  `project` - where the launch configuration stores the scripts
Returns:
  the script source container

#### readFileContents

    public static byte[] readFileContents(IFile file)
                                   throws java.io.IOException,
                                          CoreException

Throws:
  `java.io.IOException`
  `CoreException`

#### readBytes

    public static byte[] readBytes(java.io.InputStream inputStream)
                            throws java.io.IOException

Throws:
  `java.io.IOException`

#### throwUnsupported

    public static <T> T throwUnsupported()