import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
public TmfTraceStub(final String path, final int cacheSize, final long interval) throws TmfTraceException {
super(null, ITmfEvent.class, path, cacheSize, interval, null, null);
try {
- fTrace = new RandomAccessFile(path, "r");
+ fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
} catch (FileNotFoundException e) {
throw new TmfTraceException(e.getMessage());
}
public TmfTraceStub(final String path, final int cacheSize, final boolean waitForCompletion) throws TmfTraceException {
super(null, ITmfEvent.class, path, cacheSize, 0, null, null);
try {
- fTrace = new RandomAccessFile(path, "r");
+ fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
} catch (FileNotFoundException e) {
throw new TmfTraceException(e.getMessage());
}
public TmfTraceStub(final IResource resource, final String path, final int cacheSize, final boolean waitForCompletion) throws TmfTraceException {
super(resource, ITmfEvent.class, path, cacheSize, 0, null, null);
try {
- fTrace = new RandomAccessFile(path, "r");
+ fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
} catch (FileNotFoundException e) {
throw new TmfTraceException(e.getMessage());
}
final ITmfEventParser parser, final ITmfTraceIndexer indexer) throws TmfTraceException {
super(null, ITmfEvent.class, path, cacheSize, 0, indexer, null);
try {
- fTrace = new RandomAccessFile(path, "r");
+ fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
} catch (FileNotFoundException e) {
throw new TmfTraceException(e.getMessage());
}
public TmfTraceStub(final TmfTraceStub trace) throws TmfTraceException {
super(trace);
try {
- fTrace = new RandomAccessFile(getPath(), "r");
+ fTrace = new RandomAccessFile(getPath(), "r"); //$NON-NLS-1$
} catch (FileNotFoundException e) {
throw new TmfTraceException(e.getMessage());
}
@Override
public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> type) throws TmfTraceException {
try {
- fTrace = new RandomAccessFile(path, "r");
+ fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
} catch (FileNotFoundException e) {
throw new TmfTraceException(e.getMessage());
}
* @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(org.eclipse.core.resources.IProject, java.lang.String)
*/
@Override
- public boolean validate(IProject project, String path) {
- return fileExists(path);
+ public IStatus validate(IProject project, String path) {
+ if (fileExists(path)) {
+ return Status.OK_STATUS;
+ }
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TmfTraceStub_FileNotFound + ": " + path); //$NON-NLS-1$
}
}