mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-10 14:11:59 +00:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
e9e4ee48ce
@ -93,34 +93,28 @@ public class ProgramOpener {
|
||||
*/
|
||||
public Program openProgram(ProgramLocator locator, TaskMonitor monitor) {
|
||||
if (locator.isURL()) {
|
||||
try {
|
||||
return openURL(locator, monitor);
|
||||
}
|
||||
catch (CancelledException e) {
|
||||
return null;
|
||||
}
|
||||
catch (IOException e) {
|
||||
Msg.showError(this, null, "Program Open Failed",
|
||||
"Failed to open Ghidra URL: " + locator.getURL());
|
||||
}
|
||||
return null;
|
||||
return openURL(locator, monitor);
|
||||
}
|
||||
return openProgram(locator, locator.getDomainFile(), monitor);
|
||||
}
|
||||
|
||||
private Program openURL(ProgramLocator locator, TaskMonitor monitor)
|
||||
throws CancelledException, IOException {
|
||||
private Program openURL(ProgramLocator locator, TaskMonitor monitor) {
|
||||
URL ghidraUrl = locator.getURL();
|
||||
|
||||
AtomicReference<Program> openedProgram = new AtomicReference<>();
|
||||
GhidraURLQuery.queryUrl(ghidraUrl, new GhidraURLResultHandlerAdapter() {
|
||||
@Override
|
||||
public void processResult(DomainFile domainFile, URL url, TaskMonitor m) {
|
||||
Program p = openProgram(locator, domainFile, m); // may return null
|
||||
openedProgram.set(p);
|
||||
}
|
||||
}, monitor);
|
||||
|
||||
try {
|
||||
GhidraURLQuery.queryUrl(ghidraUrl, new GhidraURLResultHandlerAdapter() {
|
||||
@Override
|
||||
public void processResult(DomainFile domainFile, URL url, TaskMonitor m) {
|
||||
Program p = openProgram(locator, domainFile, m); // may return null
|
||||
openedProgram.set(p);
|
||||
}
|
||||
}, monitor);
|
||||
}
|
||||
catch (IOException | CancelledException e) {
|
||||
// IOException reported to user by GhidraURLResultHandlerAdapter
|
||||
return null;
|
||||
}
|
||||
return openedProgram.get();
|
||||
}
|
||||
|
||||
|
@ -465,12 +465,6 @@ public class FakeSharedProject {
|
||||
|
||||
void refresh() {
|
||||
DefaultProjectData projectData = getProjectData();
|
||||
try {
|
||||
projectData.refresh(true);
|
||||
}
|
||||
catch (IOException e) {
|
||||
// shouldn't happen
|
||||
throw new AssertionFailedError("Unable to refresh project " + this);
|
||||
}
|
||||
projectData.refresh(true);
|
||||
}
|
||||
}
|
||||
|
@ -742,7 +742,7 @@ public class DefaultProjectData implements ProjectData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(boolean force) throws IOException {
|
||||
public void refresh(boolean force) {
|
||||
try {
|
||||
rootFolderData.refresh(true, true, projectDisposalMonitor);
|
||||
}
|
||||
|
@ -17,14 +17,12 @@ package ghidra.framework.main.projectdata.actions;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import docking.action.*;
|
||||
import ghidra.framework.client.ClientUtil;
|
||||
import ghidra.framework.main.datatable.ProjectDataContext;
|
||||
import ghidra.framework.main.datatable.FrontendProjectTreeAction;
|
||||
import ghidra.framework.main.datatable.ProjectDataContext;
|
||||
import ghidra.framework.model.ProjectData;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.task.*;
|
||||
@ -53,13 +51,7 @@ public class ProjectDataRefreshAction extends FrontendProjectTreeAction {
|
||||
TaskLauncher.launch(new Task("Refresh folders and files", false, false, true) {
|
||||
@Override
|
||||
public void run(TaskMonitor monitor) {
|
||||
try {
|
||||
projectData.refresh(false);
|
||||
}
|
||||
catch (IOException e) {
|
||||
ClientUtil.handleException(projectData.getRepository(), e,
|
||||
"Refresh Project Data", false, comp);
|
||||
}
|
||||
projectData.refresh(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -143,9 +143,8 @@ public interface ProjectData {
|
||||
* Sync the Domain folder/file structure with the underlying file structure.
|
||||
* @param force if true all folders will be be visited and refreshed, if false
|
||||
* only those folders previously visited will be refreshed.
|
||||
* @throws IOException if an IO error occurs
|
||||
*/
|
||||
public void refresh(boolean force) throws IOException;
|
||||
public void refresh(boolean force);
|
||||
|
||||
/**
|
||||
* Returns User object associated with remote repository or null if a remote repository
|
||||
|
@ -119,7 +119,7 @@ public class TestDummyProjectData implements ProjectData {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh(boolean force) throws IOException {
|
||||
public void refresh(boolean force) {
|
||||
// stub
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user