ObjectScript

Syndicate content 26 

This code snippet allows for a file on the web to be saved into the file system. Specify the server and GET request, as well as the directory the file should be saved to. The class method "test" runs the code:


Class objectscript.saveFileHTTP Extends %RegisteredObject
{
    classmethod test() {
        Set httprequest = ##class(%Net.HttpRequest).%New()
        Set httprequest.Server = "docs.intersystems.com"
        Do httprequest.Get("documentation/cache/20172/pdfs/GJSON.pdf")
        
        Do $System.OBJ.Dump(httprequest.HttpResponse)
         
        Set stream=##class(%FileBinaryStream).%New()
        Set stream.Filename="c:\test.pdf"

        Write stream.CopyFrom(httprequest.HttpResponse.Data)
        Write stream.%Save()
    }
}

Here's a link to the code on GitHub

0 2
0

comments

126

views

+ 1

rating

Hello,

Currently, I'm working with a Java Gateway, and I have the following problem. When importing a class into IRIS, which uses methods from a generic class, I can not find the general methods I need. I'm talking about the test2 method from the class test. How can I import the java method that returns a generic?

Last answer 30 August 2018
0 3
0

comments

80

views

0

rating


Hello!

This article is a small overview of a tool that helps to understand classes and their structure inside the Caché DBMS.

In short, it visualizes a class or an entire package, shows the relations between classes and provides all the possible information to developers and team leads without making them go to Caché Studio and examine the code there.

If you are learning InterSystems Caché, reviewing Caché projects a lot or just interested in something new in InterSystems Technology solutions — you are more than welcome to read the overview of Caché Class Explorer!

Last comment 3 July 2018
1 11
2791

views

+ 17

rating